Posted By

deadmoon on 08/30/06


Tagged

mysql select display data all from


Versions (?)

display data from myusql


 / Published in: PHP
 

  1. $query = 'SELECT field1, field2 FROM thisTable ORDER BY dateline LIMIT 5';
  2. $result = mysql_query($query);
  3. $items = array();
  4. while ($row = mysql_fetch_assoc($result)) {
  5. $items[] = sprintf('<li><a href="%s">%s</a></li>', $row['field1'], $row['field2']);
  6. }
  7. //do something with $items array;

Report this snippet  

You need to login to post a comment.