I'm transferring everything in my site to a database, I got the database set up and I can sort through the data, and I have no problem viewing the files in the database, but when I try to select just ONE item from there and display it on a page, it wont work.
Here is my code:
<table border="2" cellspacing="2" cellpadding="2">
<?
$username="backbrea_testing";
$password="pass";
$database="backbrea_test";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM gameTEST2 WHERE id='$item'";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($num==0) {
echo "The game you are trying to access does not exist";
} else {
$i=0
while ($i<$num){
$gameName=mysql_result($result,$i,"gameName");
$category=mysql_result($result,$i,"category");
$shortDesc=mysql_result($result,$i,"shortDesc");
$longDesc=mysql_result($result,$i,"longDesc");
$width=mysql_result($result,$i,"width");
$height=mysql_result($result,$i,"height");
$image=mysql_result($result,$i,"image");
$file=mysql_result($result,$i,"file");
?>
<tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><? echo $gameName; ?></font></td>
</tr>
<tr>
<td align="center" border="2" height="$height" width="$width">
<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=$width HEIGHT=$height>
<PARAM NAME=movie VALUE=\"$file">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=menu VALUE=false>
<EMBED src=\"$file" quality=high WIDTH=$width HEIGHT=$height TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" menu=\"false\"></EMBED>
</OBJECT>
</td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><? echo $category; ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><? echo $longDesc; ?></font></td>
</tr>
<td><font face="Arial, Helvetica, sans-serif"><a href="<? echo $file; ?>"><? echo $file; ?></a></font></td>
</tr>
<?
$i++
}
}
echo "</table>";
?>
I made sure all the variables match, but it just wont show anything.
here is the link to the "items" in the DB, they are just a bunch of fake things i threw in there for testing, but they show up fine on the list. If you click on the image, it's suppose to take you to the page where you can actually see the file, and The code I posted above is what the page is made out of, it wont work.
http://www.backbreakergames.com/testSite/display2.php
Any help will be appreciated! Thanks 🙂