A
A
Alexander2018-03-12 15:19:24
PHP
Alexander, 2018-03-12 15:19:24

PHP error, how to fix?

Gives an error: Parse error: syntax error, unexpected '' ' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';'

$result = mysqli_query($dbc, "SELECT * FROM `table_products`");
if (mysqli_num_rows($result)>0) {
  $row = mysqli_fetch_array($result);

do
{
  echo '
<form action="" method="post" >
  <div class="producs col-md-4">
    <div class="product">
      <img src="'.$row["images"].'" width="100%" alt="">
      <a href="veiw.php?id='.$row["kod_product"].'">'.$row["name_product"]' </a>
      <p>Цена: '.$row["price_roz"].'</p>
      <a class="more" href="veiw.php?id='.$row["kod_product"].'">Подробнее</a>
    </div>
  </div>
</form>
  ';
}
while ($row = mysqli_fetch_array($result)) ;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stimulate, 2018-03-12
@AleksandrB

$result = mysqli_query($dbc, "SELECT * FROM `table_products`");
if (mysqli_num_rows($result)>0) {
  $row = mysqli_fetch_array($result);

do
{
  echo '
<form action="" method="post" >
  <div class="producs col-md-4">
    <div class="product">
      <img src="'.$row["images"].'" width="100%" alt="">
      <a href="veiw.php?id='.$row["kod_product"].'">'.$row["name_product"].'</a>
      <p>Цена: '.$row["price_roz"].'</p>
      <a class="more" href="veiw.php?id='.$row["kod_product"].'">Подробнее</a>
    </div>
  </div>
</form>
  ';
}
while ($row = mysqli_fetch_array($result)) ;

M
Maxim Timofeev, 2018-03-12
@webinar

Your mistake is simple - there is no development environment. You can look for such errors for hours, but usually you use an IDE like phpStorm or similar, and it clearly highlights where you forgot to close the bracket or put a comma, etc. So do not look for a typo, look for software that will get rid of this once and for all.
You are an IT specialist, you must think and do only what the program cannot think or do.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question