Page 1 of 1

array

Posted: Tue Aug 24, 2004 3:38 am
by sguy
why cannot show the picture using this method?
got another way to do it?
thanks...

Code: Select all

<? 
mysql_select_db($dbname, $link);
$result=mysql_query("select * from user_detail where nickname = '$name'") ;
$number_of_array = mysql_num_rows($result);
while ($number_of_array = mysql_fetch_array($result)){
echo"<img src="./image/$number_of_array[image_name]">";
}				
?>

Posted: Tue Aug 24, 2004 6:37 am
by markl999
Try:

Code: Select all

echo '<img src="/image/'.$number_of_array['image_name'].'">';
..presuming your image directory is in your document root. You should also be using mysql_error() to make sure all is well.

Posted: Tue Aug 24, 2004 8:02 am
by malcolmboston
or (my preference)

Code: Select all

{$number_of_array['image_name']}

Posted: Wed Aug 25, 2004 2:02 am
by sguy
i've tried all the possible ways to do that, but can't....

it just shows this when i check the properties of the picture, without the "william.jpg"

http://localhost/image/

Posted: Wed Aug 25, 2004 2:04 am
by John Cartwright
your localhost looks alot like mine :P

rofl.

Posted: Wed Aug 25, 2004 2:24 am
by d3ad1ysp0rk
Why are you linking to my "pictures" directory!? I thought no one knew about that!! :p

Posted: Wed Aug 25, 2004 2:37 am
by sguy
LiLpunkSkateR wrote:Why are you linking to my "pictures" directory!? I thought no one knew about that!! :p
Phenom wrote:your localhost looks alot like mine

rofl.

lol :roll:

Posted: Wed Aug 25, 2004 9:09 am
by John Cartwright
why dont u show us the proper link