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
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
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
Share on other sites

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.