Jump to content

Archived

This topic is now archived and is closed to further replies.

moria123

ORDER BY..... and tables

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.