php/mysql question

Suspended
Joined
30 Jan 2005
Posts
467
i used to have this written down, but i cant find it now so hopefully someone can help me.

if i have a database called 'me' and a table in 'me' called age, how would i echo what was in the table age, i remember it used to look similar to this i think:

echo " my age is $me[age]

but i really cant remember, sorry to give such a rubbish description of my problem.
 
Code:
$result = mysql_query("SELECT * FROM age");

while ( $row = mysql_fetch_array($result) ) {
    echo $row['hello']; // echos the contents of the field called "hello" in the "age" table.
}
 
Back
Top Bottom