Advertisement
Guest User

Untitled

a guest
May 28th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // The code below works...
  2. // It prints the column name for each row from the mysqli_query() result
  3.  
  4. while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) {
  5. echo $row["Name"];
  6. }
  7.  
  8. // However the code below should do the same but outputs the first row's column name as many times as the number of rows
  9. while ($row = mysqli_fetch_assoc($result)) {
  10. echo $row["Name"];
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement