reenadak

display data in column and rows

Sep 25th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // display data in rows and columns in a table following code can be used
  2. echo "<TABLE bordercolor=#FF00EE border=1 cellpadding=8>";
  3. $num=4;
  4. connect_db();
  5. $result=mysql_query("SELECT * FROM ".TBL_LINKS." ORDER BY ABS(hits) DESC LIMIT ".$max_links);
  6. while($row = mysql_fetch_assoc($result))
  7. {
  8. if($num%4===0) echo "<tr>";
  9. echo "n<td width=150><A HREF="".dc_siteurl."/".$row['slug']."" target=_new title="".$row['name']."">".$row['slug']."</A></td>";
  10. if($num%4===4) echo "</tr>";
  11. $num = $num+1;
  12. }
  13. mysql_close();
  14. echo "</TABLE>";
Add Comment
Please, Sign In to add comment