Re: Benefits of assigning query to variable

From: Date: Wed, 31 Jul 2002 22:35:34 +0000
Subject: Re: Benefits of assigning query to variable
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-20930@lists.php.net to get a copy of this message
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@hotmail.com> wrote in message news:20020731185942.78748.qmail@pb1.pair.com... > Are there any benefits to assigning a query to a variable? > >

« previous php.db (#20930) next »