Must results from MySQL fetches always be an Array??

From: Date: Fri, 25 Jan 2002 18:12:11 +0000
Subject: Must results from MySQL fetches always be an Array??
Groups: php.general 
Request: Send a blank email to php-general+get-82138@lists.php.net to get a copy of this message
This is sort of a "is there an easier/better way" kind of question. No error or problem, but I'd like to know how others handle it. I'm fetching single elements of data from several tables, then piecing it together. Here's an example of one element I need to fetch: $series = mysql_fetch_array(mysql_query("SELECT key2 FROM models WHERE lang='$lang' AND recordname='$model'",$db)); Now I realize that with this function $series will always be an array, even if it contains just one element (which it does). What I'd like to know is, can I write that statement so that $series is created just as a string? (So that I don't have to write "$series = $series[0];" immediately afterwards in order to treat $series as a $string.) ...Rene --- René Fournier renefournier@yahoo.com

« previous php.general (#82138) next »