Hi,
I am trying to create a script, which can get info from the database and display it according to the category # set in the table. For some reason it will not display the selected info under the selected category chosen.
Here's the table:

What I want to do is use the "catid" and place info in the "catid" chosen into a table on my site.
For example:
I want to place all info in "catid 2" into my page. So in calling that on my webpage I get:
Artist Track Uploaded Preview
Boys 2 Men End of The Road polys/003.mid
Busta Rhymes Break Your Neck polys/005.mid
Here is my code so far:
<?php if (!eregi("modules.php", $PHP_SELF))
{ die ("You can't access this rows directly..."); }
$index = 0; require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
opentable();
echo"<table width=\"100%\">"
. " <tr>"
. " <td width=\"16%\">Artist</td>"
. " <td width=\"16%\">Track</td>"
. " <td width=\"16%\">Uploaded</td>"
. " <td width=\"16%\">Downloads</td>"
. " <td width=\"16%\">Preview</td>"
. " <td width=\"16%\">ID</td>"
. " </tr>"
. " </table>";
closetable();
echo"<br>";
$resultpersons = sql_query("SELECT toneid, toneartist, tonetrack, tonefile, tonedl, tonedate, catid FROM ".$prefix."_tones ORDER BY toneartist" , $dbi);
for ($m=0; $m < sql_num_rows($resultpersons, $dbi);
$m++) { list($toneid, $toneartist, $tonetrack, $tonefile, $tonedl, $tonedate, $catid) = sql_fetch_row($resultpersons, $dbi);
}
if ($catid == "1") {
opentable();
echo"<table width=\"100%\">"
. " <tr>"
. " <td width=\"16%\">$toneartist</td>"
. " <td width=\"16%\">$tonetrack</td>"
. " <td width=\"16%\">$tonedate</td>"
. " <td width=\"16%\"><center>$tonedl</center></td>"
. " <td width=\"16%\">$tonefile</td>"
. " <td width=\"16%\">$toneid</td>"
. " </tr>"
. " </table>";
closetable();
echo"<table>"
."<tr>"
. " <td height=\"1\"></td>"
."</tr>"
."</table>";
} else {
opentable();
echo"<table width=\"100%\">"
. " <tr>"
. " <td width=\"100%\"><center>Nothing Here!</center></td>"
. " </tr>"
. " </table>";
closetable();
}
include("footer.php");
?>
At the moment as you can see i'm using:
if ($catid == "1") {
However this does not seem to work and I get my "Nothing Here!" on the page. Does anybody know how to fix this?.
Hopefully someone here will understand what I am trying to ask.
Thanks to anyone who can help.