On Fri, 25 Jan 2002, [ISO-8859-1] René Fournier wrote:

> $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.)

If you're sure that mysql_fetch_array is always returning an array with
a single element, you could use implode to convert the array to a
string...

$series = implode('', mysql_fetch_array(mysql_query( ...

Check http://www.php.net/manual/en/function.implode.php for details on
the implode function.

mh


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to