Jump to content

Archived

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

redarrow

no pic prolam please help cheers

Recommended Posts

I got a strange problam the first picture within the database shows, Then i added a if condition to cheeck the pictire is in the database then show it, then i said if the condition is 0 show a no pic but dosent show.

what does show is the image placement but not the nopic.gif.

The nopic.gif is not in the database as a name but in a folder and does work.


please help cheers


[code]
$picture='select * from members_picture_uploads where id='.$row['id'].' ';

$data=mysql_query($picture);

if(!$data["userfile_name"]==1) {

while($pic=mysql_fetch_assoc($data)){

$link='<img width="150" src="members_uploads/'.$pic["userfile_name"].'"></img>';
}

}else{

$no_picture='select * from members_picture_uploads where id='.$row['id'].' ';

$get_picture=mysql_query($no_picture);

if(!$get_picture["userfile_name"]==0) {

$link='<img width="150" src="no_picture/nopic.gif"></img>';
}
}
[/code]

Share this post


Link to post
Share on other sites
no_picture/nopic.gif

The path to nopic.gif is probably invalid or incorrect. Or the file doesn't exist.

Share this post


Link to post
Share on other sites
[!--quoteo(post=375655:date=May 21 2006, 04:17 AM:name=Ferenc)--][div class=\'quotetop\']QUOTE(Ferenc @ May 21 2006, 04:17 AM) [snapback]375655[/snapback][/div][div class=\'quotemain\'][!--quotec--]
no_picture/nopic.gif

The path to nopic.gif is probably invalid or incorrect. Or the file doesn't exist.
[/quote]

No no no no no

The pic there ok!

The only way i see to solve this problam is to insert into the database a nopic.gif from the start and then let the user change there pic.

But i wanted to displaly a nopic picture if the userfile field was empty but no luck yet cheers.

Share this post


Link to post
Share on other sites
i tried this aswell but still no joy.

i have placed the nopic.gif in the same folder as the members_uploads where the members pictures go.

what i was trying to do in this code is if the userfile_name is 0 then change the userfile_name to the nopic.gif name but no luck yet.


[code]

$picture='select * from members_picture_uploads where id='.$row['id'].' ';

$data=mysql_query($picture);

while($pic=mysql_fetch_assoc($data)){


if(!$pic["userfile_name"]==0){

$pic["userfile_name"]="nopic.gif";

}else{

if(!$pic["userfile_name"]==1){

$link='<img width="150" src="members_uploads/'.$pic["userfile_name"].'"></img>';
}
}
}
[/code]

Share this post


Link to post
Share on other sites
holly grail

[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--]

[code]

$picture='select * from members_picture_uploads where id='.$row['id'].' ';

$data=mysql_query($picture);

while($pic=mysql_fetch_assoc($data)){

if($pic['userfile_name']){

$link='<img width="150" src="members_uploads/'.$pic["userfile_name"].'"></img>';

}else{

$link='<img width="150" src="members_uploads/nopic.gif"></img>';
}
}
[/code]

Share this post


Link to post
Share on other sites

×

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.