redarrow Posted May 21, 2006 Share Posted May 21, 2006 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 More sharing options...
Ferenc Posted May 21, 2006 Share Posted May 21, 2006 no_picture/nopic.gif The path to nopic.gif is probably invalid or incorrect. Or the file doesn't exist. Link to comment https://forums.phpfreaks.com/topic/10096-no-pic-prolam-please-help-cheers/#findComment-37577 Share on other sites More sharing options...
redarrow Posted May 21, 2006 Author Share Posted May 21, 2006 [!--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 noThe 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. Link to comment https://forums.phpfreaks.com/topic/10096-no-pic-prolam-please-help-cheers/#findComment-37581 Share on other sites More sharing options...
redarrow Posted May 21, 2006 Author Share Posted May 21, 2006 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] Link to comment https://forums.phpfreaks.com/topic/10096-no-pic-prolam-please-help-cheers/#findComment-37589 Share on other sites More sharing options...
redarrow Posted May 21, 2006 Author Share Posted May 21, 2006 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] Link to comment https://forums.phpfreaks.com/topic/10096-no-pic-prolam-please-help-cheers/#findComment-37592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.