Ok. Um. Yea, that code is a little more confusing looking. Could you maybe explain it a little better than that guy? Cuz I did what he said...but..nothing happened other than I got this on my page:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/wowtahc1/public_html/achievements.php on line 7
">
Line 7 is:
<img src="showavatar.php?id="<?php echo mysql_result($avatardetail, 0, "ID"); ?>">
now I realize it could be because of $avatardetail cuz that could be something from the guy's database but I dont know the equivilence of it to mine. I did name the .php I put the code in called showavatar.php for the sake of simplicity for now so I know that isn't the issue.
But, I don't think that's the only issue we will run into so, lets also solve some others. Here is the code I put in, (for the sake of showing you my changes trying to get it to function with my database):
<?php
require("tools.php");
if(isset($id))
{
$filedata = mysql_query("SELECT * FROM general WHERE ID = '".$id."' LIMIT 1");
header("Content-type: \"".mysql_result($filedata, 0, "filetype")."\"");
// Work out whether we can show or download the attachment:
$mimetype = explode("/", $row["filetype"]);
if($mimetype[0] != "Picture")
{
header("Content-length: ".mysql_result($filedata, 0, "filesize"));
header("Content-Disposition: attachment; filename=".mysql_result($filedata, 0, "filename"));
header("Content-Description: PHP Generated Data");
}
echo mysql_result($filedata, 0, "Avatar");
}
?>
I highlighted in red again the changes that I made. I think also I should change "Avatar"? but I dont know to what. Also, I don't see how in this code I can place the image where I want it....
Also, whats tools.php? That code says it requires it and, I can see it on my tabs, it's there, but it's blank.