Jump to content


Photo

Problems with image


  • Please log in to reply
3 replies to this topic

#1 Johnnnnny1986

Johnnnnny1986
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 30 October 2006 - 11:48 AM

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

Ithought the coding whould be:
 $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
}
But that didnt work.

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 30 October 2006 - 11:56 AM

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
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 Johnnnnny1986

Johnnnnny1986
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 30 October 2006 - 11:58 AM

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


Yes to all :)

#4 Johnnnnny1986

Johnnnnny1986
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 30 October 2006 - 04:13 PM

Anyone got any ideas? Please :-\




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users