Fw: [PHP] mysql query

From: Date: Tue, 10 Sep 2002 17:23:24 +0000
Subject: Fw: [PHP] mysql query
Groups: php.general 
Request: Send a blank email to php-general+get-115867@lists.php.net to get a copy of this message
Try mysql_result(); in place of that entire while() loop. http://www.php.net/manual/en/function.mysql-result.php Also there's no reason for you to use mysql_free_result() unless you're going to be performing multiple massive SELECTS before the script exits. -Kevin ----- Original Message ----- From: "Chris Schoeman" <c.schoeman@eudoramail.com> To: <php-general@lists.php.net> Sent: Tuesday, September 10, 2002 10:53 AM Subject: [PHP] mysql query > I use the script below to get one value out of a database: > > $result = mysql_query("select euro from brandstofprijzen where id=2") > or die (mysql_error()); > while ($row = mysql_fetch_array($result)) > { > $euro = $row["euro"]; > } > mysql_free_result($result); > > This is working fine, but is there an easier (less code) way to do > this? > > Thankx > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#115867) next »