Jump to content

mysql select returns the right filename but still no image


offsprg01

Recommended Posts

well i finally got the stupid image uploader working, now i'm having a hell of a time getting the image to show up.

 

here's my code to pull the filename from the db and place it in a var to be echoed later

 

mysql_select_db($database_TestDB, $TestDB);
$cdate = date ('Y-m-d');

$query_PromoLeftSelect = "SELECT * FROM PromoImages ORDER BY StartDate DESC Limit 1";
$PromoLeftSelect = mysql_query($query_PromoLeftSelect, $TestDB) or die(mysql_error());
$row_PromoLeftSelect = mysql_fetch_assoc($PromoLeftSelect);
$totalRows_PromoLeftSelect = mysql_num_rows($PromoLeftSelect);

$leftPromo = $row_PromoLeftSelect['FileName'];

$query_PromoRightSelect = "SELECT * FROM PromoImages ORDER BY EndDate DESC Limit 1";
$PromoRightSelect = mysql_query($query_PromoRightSelect, $TestDB) or die(mysql_error());
$row_PromoRightSelect = mysql_fetch_assoc($PromoRightSelect);
$totalRows_PromoRightSelect = mysql_num_rows($PromoRightSelect);

$rightPromo = $row_PromoRightSelect['FileName'];

 

this this is the code to put the image in the site...

 

<img src="admin/uploads/<?php echo $leftPromo; ?>" alt="promo1" width="349" height="64" />
<img src="admin/uploads/<?php echo $rightPromo; ?>" alt="promo2" width="349" height="64" />
[code]


here's a link to the file

http://www.harwoodmarketinggroup.com/WIP/

[/code]

HaLo2FrEaEk the link is actually: http://www.harwoodmarketinggroup.com/WIP/admin/uploads/promo1.jpg

and it does work, except it says permissions are denied. make sure the folder and file permissions are 755 or 777 i think.

  • 3 weeks later...

off, I'm glad you got it fixed, fear, I went to the site, right clicked where the image should have been and clicked properties and copied exactly what was in the URL value, don't try to tell me I got it wrong, it was right when I did it.  I know what I'm doing, I've been doing computers for some years now.

off, I'm glad you got it fixed, fear, I went to the site, right clicked where the image should have been and clicked properties and copied exactly what was in the URL value, don't try to tell me I got it wrong, it was right when I did it.  I know what I'm doing, I've been doing computers for some years now.

 

lol no need to take it so personally....

 

you did miss the admin directory out of the link mind....

No I didn't, it might be there now, but when I right cliked the image, I copied the url exactly as it was, I didn't retype it, I copied and pasted it, without editing, the admin directory was not in the url, I know what I'm doing.  I'm sorry I took it personally, its just...computer people don't get much...recognition in the world, you know what I mean, and they are probably the smartest, or almost, out there, its frustrating to say the least.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.