Jump to content

[SOLVED] Image not appeaaring


mike12255

Recommended Posts

I created some code to grab and image from X folder and by X name (both combined into one var called $image) i get no errors when i view the page, but the images don't appear. I tried echoing $name and it showed up properly as uploads/image.gif

 

heres my code :

 

<?php   
    
    $findimage = mysql_query ("Select * FROM `phpbb_files`");

while ($row = mysql_fetch_array($findimage)){
$image ="uploads/"; 
$image .= $row['shortname'];


?>
<img src= <?=$image?> />

<?php }?>

Link to comment
Share on other sites

I tried what you mates suggested so i've been editing it, and got the following error:

 

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sgiclan/public_html/gnomes/images.php on line 466

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sgiclan/public_html/gnomes/images.php on line 467

 

<?php   
    error_reporting(E_ALL);
   $findimage = mysql_query ("Select * FROM `phpbb_files`") or die(mysql_error());
   echo mysql_num_rows($findimage['shortname']);
   while ($row = mysql_fetch_array($findimage['shortname'])){
   $image ="uploads/"; 
   $image .= $row['shortname'];

echo "<img src=\"".$image."\"  alt=\"Image can not be found\" />";
}
?>

Link to comment
Share on other sites

What the hell, is that your code?

 

Do this

<?php   
    error_reporting(E_ALL);

   $findimage = mysql_query ("Select * FROM `phpbb_files`") or die(mysql_error());
   echo mysql_num_rows($findimage);

   while ($row = mysql_fetch_array($findimage)){
   $image ="uploads/"; 
   $image .= $row['shortname'];

echo "<img src=\"".$image."\"  alt=\"Image can not be found\" />";
}
?>

And tell us what it says

Link to comment
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.