Adding pic into mysql *updated 2/2/04

Started by Doh004, January 30, 2004, 10:22:53 PM

Previous topic - Next topic

morph

Well then that means somewhere along the line, the if statement is not true... So what you should do to test this is put the following ABOVE the if statement.

echo $_FILES['uploadedfile']['type'];
echo $_FILES['uploadedfile']['size'];


See if it should be true.

Coming soon!

Doh004

Wait

I added '. .' and it worked. Cept now the pic that is dislplayed is this url: http://www.dohgames.com/roms/ss/.Array[name].

Thanks

Doh004

#22
edit* Nevermind I would like to thank the color coding on these forums for helping me out ;)

Tyris

if you like colour coding, use a good php editor that does that ;)
I used notepad until I found dev-php (http://devphp.sourceforge.net) which is great :) (you can even hook it up to your php install and have it parse for errors).

Doh004

#24
Thanks for the link but i'm getting another parse error on line 54 that doesnt exist so i must be missing something. I need another pair of eyes to see it please:
<html>
<head>
<?php include("includes.php"); ?>
<title>
<?php echo"$title"; ?>
</title>
</head>
<body bgcolor="#4b4b4b" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="100%" border="0" cellpadding="3" cellspacing="3">
<?php
$default
= "news";
if(
$id == ""){$id = $default;}elseif(isset($id)){$id = $id;};

include(
"dbconnect.php");

$result = mysql_query('SELECT * FROM roms_snes where rom_id = ' . $id)
or die(mysql_error());
while (
$row =  mysql_fetch_assoc($result))
{
echo
'<tr bgcolor="#333333"><td align="center" colspan="2" width="80%"><font size="2" face="verdana">';
echo
$row['name'];
echo
'</font></td></tr><tr bgcolor="#4b4b4b"><td width="45%" bgcolor="#333333" valign="top"><font size="1"face="verdana"><b>Name: </b>';
echo
$row['name'];
echo
'<br><br><b>File Size: </b>';
echo
$row['size'];
echo
' Kb<br><br><b>Downloads: </b>';
echo
$row['downloads'];
echo
'<br><br><b>System: </b>';
echo
$row['system'];
echo
'<br><br><b>Votes For: </b>';
echo
$row['rate_up'];
echo
'<br><br><b>Votes Against: </b>';
echo
$row['rate_down'];
echo
"<br><br><center><b>Rate this Rom</b><br><br><a href=\"rate_up.php?id=$id\"><img border=\"0\" src=\"http://www.dohgames.com/thup.gif\"></a> - <a href=\"rate_down.php?id=$id\"><img border=\"0\" src=\"http://www.dohgames.com/thudwn.gif\"></a></center></font></td><td bgcolor=\"#333333\" width=\"55%\" rowspan=\"2\"><center>";
if ( $row['ss_1'] != upload.png )
{
echo
'<img width="256" height="222" src="http://www.dohgames.com/roms/ss/';
echo
$row['ss_1'];
echo
'"></center></td></tr>';
}
else
{
echo
'<center><img src="http://www.dohgames.com/roms/ss/upload.png"></center><br>';
echo
"<center><font size\"1\" face=\"verdana\"><a href=\"http://www.dohgames.com/roms/ss/upload-snes.php?id=$id\">Upload a Screenshot</a></font></center></td></tr>";
echo
"<tr bgcolor=\"#333333\" width=\"80%\"><td><font size=\"1\" face=\"verdana\"><center><a href=\"download.php?id=$id\">Download ".$row["name"]."</a></center></font></td></tr>";
}
mysql_free_result($result);
?>
</table><br>
<font size="2" face="verdana"><center><a href="javascript:history.back(1)">Return to the Download Manager</a></center></font>
</body>
</html>

Tyris

if($id == ""){$id = $default;}elseif(isset($id)){$id = $id;};

no ; on the end.

and the while doesnt close (thats why you're getting an error on a line that doesnt exist.)

morph

".$row["name"]."

should probably be

".$row['name']."

On line 53 (if I counted correctly.. could be 54... {we need line number in the code boxes :P})

Coming soon!

Tyris

heh... I didnt scroll across so I missed that bit... :-[

Doh004

<html>
<head>
<?php include("includes.php"); ?>
<title>
<?php echo"$title"; ?>
</title>
</head>
<body bgcolor="#4b4b4b" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="100%" border="0" cellpadding="3" cellspacing="3">
<?php
$default
= "news";
if(
$id == ""){$id = $default;}elseif(isset($id)){$id = $id;};

include(
"dbconnect.php");

$result = mysql_query('SELECT * FROM roms_snes where rom_id = ' . $id)
or die(mysql_error());
while (
$row =  mysql_fetch_assoc($result))
{
echo
'<tr bgcolor="#333333"><td align="center" colspan="2" width="80%"><font size="2" face="verdana">';
echo
$row['name'];
echo
'</font></td></tr><tr bgcolor="#4b4b4b"><td width="45%" bgcolor="#333333" valign="top"><font size="1"face="verdana"><b>Name: </b>';
echo
$row['name'];
echo
'<br><br><b>File Size: </b>';
echo
$row['size'];
echo
' Kb<br><br><b>Downloads: </b>';
echo
$row['downloads'];
echo
'<br><br><b>System: </b>';
echo
$row['system'];
echo
'<br><br><b>Votes For: </b>';
echo
$row['rate_up'];
echo
'<br><br><b>Votes Against: </b>';
echo
$row['rate_down'];
echo
"<br><br><center><b>Rate this Rom</b><br><br><a href=\"rate_up.php?id=$id\"><img border=\"0\" src=\"http://www.dohgames.com/thup.gif\"></a> - <a href=\"rate_down.php?id=$id\"><img border=\"0\" src=\"http://www.dohgames.com/thudwn.gif\"></a></center></font></td><td bgcolor=\"#333333\" width=\"55%\" rowspan=\"2\"><center>";
if ( $row['ss_1'] != upload.png )
{
echo
'<img width="256" height="222" src="http://www.dohgames.com/roms/ss/';
echo
$row['ss_1'];
echo
'"></center></td></tr>';
}
else
{
echo
'<center><img src="http://www.dohgames.com/roms/ss/upload.png"></center><br>';
echo
"<center><font size\"1\" face=\"verdana\"><a href=\"http://www.dohgames.com/roms/ss/upload-snes.php?id=$id\">Upload a Screenshot</a></font></center></td></tr>";
echo
"<tr bgcolor=\"#333333\" width=\"80%\"><td><font size=\"1\" face=\"verdana\"><center><a href=\"download.php?id=$id\">Download ".$row["name"]."</a></center></font></td></tr>";
}
mysql_free_result($result);
}
?>
</table><br>
<font size="2" face="verdana"><center><a href="javascript:history.back(1)">Return to the Download Manager</a></center></font>
</body>
</html>

and I get this above: Warning: mysql_fetch_assoc(): 5 is not a valid MySQL result resource in /home/dohgames/public_html/roms/snes/view.php on line 18

Tyris

you're clearing the result before you're getting thru it...

mysql_free_result($result);
}

replace with

}
mysql_free_result($result);

Doh004

#30
Thanks and I gots another problem. For some reason the a href of the upload-snes.php file that I want to be over the image that says upload a screenshot isnt working:
<html>
<head>
<?php include("includes.php"); ?>
<title>
<?php echo"$title"; ?>
</title>
</head>
<body bgcolor="#4b4b4b" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="100%" border="0" cellpadding="3" cellspacing="3">
<?php
$default
= "news";
if(
$id == ""){$id = $default;}elseif(isset($id)){$id = $id;};

include(
"dbconnect.php");

$result = mysql_query('SELECT * FROM roms_snes where rom_id = ' . $id)
or die(mysql_error());
while (
$row =  mysql_fetch_assoc($result))
{
echo
'<tr bgcolor="#333333"><td align="center" colspan="2" width="80%"><font size="2" face="verdana">';
echo
$row['name'];
echo
'</font></td></tr><tr bgcolor="#4b4b4b"><td width="45%" bgcolor="#333333" valign="top"><font size="1"face="verdana"><b>Name: </b>';
echo
$row['name'];
echo
'<br><br><b>File Size: </b>';
echo
$row['size'];
echo
' Kb<br><br><b>Downloads: </b>';
echo
$row['downloads'];
echo
'<br><br><b>System: </b>';
echo
$row['system'];
echo
'<br><br><b>Votes For: </b>';
echo
$row['rate_up'];
echo
'<br><br><b>Votes Against: </b>';
echo
$row['rate_down'];
echo
"<br><br><center><b>Rate this Rom</b><br><br><a href=\"rate_up.php?id=$id\"><img border=\"0\" src=\"http://www.dohgames.com/thup.gif\"></a> - <a href=\"rate_down.php?id=$id\"><img border=\"0\" src=\"http://www.dohgames.com/thudwn.gif\"></a></center></font></td><td bgcolor=\"#333333\" width=\"55%\" rowspan=\"2\"><center>";
if ( ($row['ss_1'] != upload.png) )
{
echo
'<img width="256" height="222" src="http://www.dohgames.com/roms/ss/';
echo
$row['ss_1'];
echo
'"></center></td></tr>';
}
else
{
echo
"<a href=\"http://www.dohgames.com/roms/ss/upload-snes.php?id=$id\"><img src=\"http://www.dohgames.com/roms/ss/upload.png\"></a><br>";
}
echo
"<tr bgcolor=\"#333333\" width=\"80%\"><td><font size=\"1\" face=\"verdana\"><center><a href=\"download.php?id=$id\">Download ".$row["name"]."</a></center></font></td></tr>";
}
mysql_free_result($result);
?>
</table><br>
<font size="2" face="verdana"><center><a href="javascript:history.back(1)">Return to the Download Manager</a></center></font>
</body>
</html>

I'm just not getting a link..

Advertisement: