Re: Store more than 1 piece of information in a single variable

From: Date: Fri, 03 Aug 2007 18:13:58 +0000
Subject: Re: Store more than 1 piece of information in a single variable
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-43880@lists.php.net to get a copy of this message
> First.. You're using mysql_fetch_array when you wanted > mysql_fetch_assoc.. .. select user_id from whatever .. and then $row = > mysql_fetch_array($res) .. youd have a $row[0].. mysql_fetch_assoc > would allow $row['user_id'] mysql_fetch_array($res) will fetch both associative and numerical indexes, so it will have $row[0] and $row['user_id'] in it. It has an optional second parameter to indicate associative, numerical or both, defaulting to both. mysql_fetch_row only fetches numerically indexed arrays -- Niel Archer

« previous php.db (#43880) next »