Jump to content

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]
Link to comment
https://forums.phpfreaks.com/topic/10096-no-pic-prolam-please-help-cheers/
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.
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]
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]
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.