Hello,
on 09/19/2008 06:39 AM Nik Sands said the following:
> but in the situation I showed in my last example, it produces invalid
> SQL. Shouldn't this be avoided, no matter what the value of the
> variable?
>
> Metastorage knew the variable had no valid value (hence it displaying
> the "?" in the "PrepareQuery" line of the debug output), shouldn't it
> be doing something with that invalid value? (Eg, set it to NULL in
> SQL, or report an error and don't run any SQL)
? in the prepared query is just a place holder that will be placed by
the real value when the query is executed. If the variable is set to a
value, ? is replaced by the value. Otherwise it is replaced by NULL.
It should not give any errors if you set the variable to null .
Anyway, just send me your class definition in the component format so I
can check what may not be right.
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/