array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
sguy
Forum Commoner
Posts: 61
Joined: Sun Aug 10, 2003 2:44 am

array

Post 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]">";
}				
?>
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post 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.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

or (my preference)

Code: Select all

{$number_of_array['image_name']}
User avatar
sguy
Forum Commoner
Posts: 61
Joined: Sun Aug 10, 2003 2:44 am

Post 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/
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

your localhost looks alot like mine :P

rofl.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Why are you linking to my "pictures" directory!? I thought no one knew about that!! :p
User avatar
sguy
Forum Commoner
Posts: 61
Joined: Sun Aug 10, 2003 2:44 am

Post 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:
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

why dont u show us the proper link
Post Reply