B
B
BoriHagen2020-04-23 13:00:15
PHP
BoriHagen, 2020-04-23 13:00:15

What's wrong with PHP?

<? while (($orders_data = mysqli_fetch_assoc($orders_result))) {
        echo '<div class="main__orders-list__order">';
        echo '<div class="main__orders-list__order__order-number">' . $orders_data['order_number'] . '</div>';
        echo '<div class="main__orders-list__order__customer-name">' . $orders_data['customer_surname'] . ' ' . $orders_data['customer_name'] . ' ' $orders_data['customer_patronymic'] . '</div>';
        echo '<div class="main__orders-list__order__customer-phone">' . $orders_data['phone_number'] . '</div>';
        echo '<div class="main__orders-list__order_order-status">'. $orders_data['order_status'] . '</div>';
        echo '</div>'
      } ?>


Parse error: syntax error, unexpected '$orders_data' (T_VARIABLE), expecting ',' or ';' in C:\OSPanel\domains\crm\www\crm_index.php on line 35 line

35 is:

echo '<div class="main__orders-list__order__customer-name">' . $orders_data['customer_surname'] . ' ' . $orders_data['customer_name'] . ' ' $orders_data['customer_patronymic'] . '</div>';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2020-04-23
@BoriHagen

' ' $orders_data['customer_patronymic']there is no dot after the quotes.
Hint: if the error is in a single line, then you can break the line into shorter ones.
Well, in general, any IDE and most editors with syntax highlighting will highlight such errors even before running the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question