Jump to content


ORDER BY..... and tables

  • Please log in to reply
1 reply to this topic

#1 moria123

  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 20 November 2003 - 07:14 PM

I have the following code....

<html><title>Releases</title<?php $db = mysql_connect("localhost", "XXXX", "XXXXX");mysql_select_db("XXXXXX" ,$db);$title = "Mazza\'s Place";$result = mysql_query("SELECT * FROM releases ORDER BY game", $db);echo "Release Dates";echo "<table border=1>n";echo "<tr><td><b>Game Title</b></td><td><b>Format</b></td><td><b>Developer</b></td><td><b>Release Date</b></td></tr>n";while ($myrow = mysql_fetch_row($result)) {  printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>n", $myrow[1], $myrow[3], $myrow[4], $myrow[2]);}echo "</table>n";?></html>

When I view it (www.mazzas-place.com/nuke/modules/Releases/index2.php) it just comes out as plain text, not in a table.... But when I take the ORDER BY thing out, it works fine... (www.mazzas-place.com/nuke/modules.php?name=Releases).

How do I get the first one to go into a table? Thanks

#2 triphis

  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 20 November 2003 - 09:31 PM

Have you tried \"ORDER BY game ASC\" ? That will put it in alphabetical order, and it might be going swcrewy because you don\'t have that.

You do a lot of echoing. If my previous suggestion doesn\'t work, try the table outside of PHP, and using <?=$variable?> to call the variables.
Xac Attack

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users