Jump to content

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

Link to comment
https://forums.phpfreaks.com/topic/1402-order-by-and-tables/
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.

Link to comment
https://forums.phpfreaks.com/topic/1402-order-by-and-tables/#findComment-4657
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.