Re: Newbie mysql question

From: Date: Fri, 19 Jul 2002 21:38:26 +0000
Subject: Re: Newbie mysql question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108586@lists.php.net to get a copy of this message
JW> If i KNOW this query will only return one "piece" of data, what, php'ly JW> speaking, must i do to assign it to the var $id? JW> SELECT id FROM ma_users WHERE user='$PHP_AUTH_USER' You can do like this $result = mysql_query("SELECT id FROM ma_users WHERE user='$PHP_AUTH_USER'"); $row = mysql_fetch_array($result); $id = $row['id']; -- Best regards, Asmodean mailto:asmodean@lka.nu

« previous php.general (#108586) next »