The code displays all the records except the first (problem) Query:

$querycom = "SELECT * FROM comments WHERE el=$el"; $resultcom = mysql_query($querycom); 

Output to page:

  while($r=mysql_fetch_array($resultcom)){ echo '<div align="center" id="addkomment">'.$r[comment].'</div>'; } 
  • one
    And if you remove the condition WHERE el = $ el, then it will output normally? - Deonis
  • No, displays all records, except the first. - glarionenko
  • Construct, yes, in the database request file ... removed, HELPED, thanks - glarionenko
  • @glarionenko, only I did not help you) - Oleg Arkhipov
  • Oh, well, in general, ALL thanks))) - glarionenko

2 answers 2

Did you happen to do mysql_fetch_array() before the loop?

  • Similarly, most likely, the first time is not displayed only. - Oleg Arkhipov
  • Yes, thank you very much - glarionenko
  • Please) - AseN
 $r['comment'] 

Missing quotes. Array string indices must be in quotes.

  • This is most likely a mistake, because the preprocessor would let know about this error and the code would simply not run ... - AseN