Re: calling values from a database

From: Date: Mon, 11 Feb 2002 19:26:59 +0000
Subject: Re: calling values from a database
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-16818@lists.php.net to get a copy of this message
while( $row = mysql_fetch_assoc($result) ) { print $row[field]; } where "field" is your fieldname as defined in your query. ----- Original Message ----- From: "Jacob Wyke" <kettle_drum@yahoo.com> To: <php-db@lists.php.net> Sent: Monday, February 11, 2002 2:25 PM Subject: [PHP-DB] calling values from a database > How can i get a value from a database into a variable??? > > $db = mysql_connect("localhost", "", ""); > > mysql_select_db("TEST", $db); > > $result = mysql_query("SELECT max(ID) FROM Tut_Main", $db); > > > But when i try to print $result it displays Resource id #2 instead. > > Please help if u can, cheers. > > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#16818) next »