N
N
Nikita Bratsky2018-03-11 19:31:28
PHP
Nikita Bratsky, 2018-03-11 19:31:28

What is the problem in php code? Gets only one row, although there are more than 6 rows in the database?

$orderslist = mysqli_query($con, "SELECT * FROM bills LIMIT 25");
  while($orderslist = mysqli_fetch_assoc($orderslist)){
  echo "<td>".$orderslist['id']."</td>
    <td>".$orderslist['color']."</td><td>".$orderslist['name']."</td><td>".$orderslist['telephone']."</td><td>".$orderslist['email']."</td><td>".$orderslist['adress']."</td><td>".$orderslist['count']."</td>";
 }
  echo "</tr></table></section> ";
}

Error: Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2018-03-11
@NikBr_9

Why are you using $orderslist twice? rewrite in the loop at the first iteration, here is the result

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question