[PHP-DB] Re: Benefits of assigning query to variable From: Jas (jlgerfen <email protected>)
Date: 07/31/02

sure there are, you can call the query in multiple places, for example:

$sql = mysql_query("INSERT INTO $table_name WHERE db_field =
$search_string");

Then say you have a routine to check for missing for elements and you would
like to log failed vs. successfull attempts your code flow would be
something like:

if (!$search_string && !$var02) {
    $sql;
} else {
    $sql; }
HTH
Jas

"Brian Graham" <croakingfrog <email protected>> wrote in message
news:20020731185942.78748.qmail <email protected>
> Are there any benefits to assigning a query to a variable?
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php