Jump to content

Problems with image


Johnnnnny1986

Recommended Posts

Im having probs gettin a link for a picture from my database to shoow the picture.

Ithought the coding whould be:
[code]
$sqlthing = mysql_query("SELECT * FROM members WHERE username='$username'");
   $pic=(mysql_result($sqlthing,0,"pic"));
if($pic>0)
{
$sqlthing = mysql_query("SELECT * FROM profile WHERE username='$username'");
   $piclink=(mysql_result($sqlthing,0,"piclink"));
?>
<img src="$piclink" alt="My Pic"/><br/>
<?php
}
[/code]
But that didnt work.
Link to comment
https://forums.phpfreaks.com/topic/25570-problems-with-image/
Share on other sites

I'm assuming from the code that the column 'pic' in the 'members' table contains either a 1 or a 0 depending on if they have a picture on their profile and the 'piclink' column in the 'profile' table, just contains the location of the image, e.g. http://mydomain.com/image.jpg

Is this correct?

Also, does every member have a row in the 'profile' table?

Regards
Huggie
Link to comment
https://forums.phpfreaks.com/topic/25570-problems-with-image/#findComment-116681
Share on other sites

[quote author=HuggieBear link=topic=113214.msg459910#msg459910 date=1162209410]
I'm assuming from the code that the column 'pic' in the 'members' table contains either a 1 or a 0 depending on if they have a picture on their profile and the 'piclink' column in the 'profile' table, just contains the location of the image, e.g. http://mydomain.com/image.jpg

Is this correct?

Also, does every member have a row in the 'profile' table?

Regards
Huggie
[/quote]

Yes to all :)
Link to comment
https://forums.phpfreaks.com/topic/25570-problems-with-image/#findComment-116682
Share on other sites

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.