Jump to content

Archived

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

Johnnnnny1986

Problems with image

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.

Share this post


Link to post
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

Share this post


Link to post
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 :)

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.