GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Aug-2004, 08:59
skyloon skyloon is offline
Junior Member
 
Join Date: Jun 2003
Posts: 53
skyloon is an unknown quantity at this point

statement inside array


PHP Code:

while ($number_of_array = mysql_fetch_array($query)) {

    echo "<TD><a href=viewuser.php?name=$number_of_array[nickname] target=_blank>$number_of_array[nickname]</a></TD>\n";    
    echo "<TD>$number_of_array[gender]</TD>\n"; 
    echo "<TD>$age</TD>\n"; 
    echo "<TD>$number_of_array[location]</TD>\n"; 
    echo "<TD>$number_of_array[country]</TD>\n"; 
} 



can i put the if else statement or while loop behind:
<a href=viewuser.php?name=$number_of_array[nickname] target=_blank>$number_of_array[nickname]</a>

if the value is equal to 1, then echo a picture

something like the picture attached...

i've tried, but got error...

thanks.
Attached Images
File Type: jpg pic.JPG (18.7 KB, 5 views)
Last edited by JdS : 26-Aug-2004 at 07:29. Reason: Please insert your example PHP codes between [php] and [/php] tags
  #2  
Old 25-Aug-2004, 11:02
skyloon skyloon is offline
Junior Member
 
Join Date: Jun 2003
Posts: 53
skyloon is an unknown quantity at this point
in my table has 1 column named "image", default is 0.
when i upload the picture, the 0 will set to 1.
then check the value, if the value is equal to 1, then show the camera.gif
this is what i meaned...
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help a C++ Idiot: I am trying to fill an array based on a switch statement. Psycop C Programming Language 2 14-Apr-2004 03:12
Speed up C++ code about 3d array! Truong Son CPP / C++ Forum 0 16-Mar-2004 21:52
c: array comparison jack C Programming Language 7 26-Jan-2004 11:21
Extra null element in an array samtediou MySQL / PHP Forum 2 11-Dec-2003 11:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:33.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.