I'm using SQLite with PHP and I want to know if my query failed or not.
Does query return FALSE in a case of a failure?
I'm using SQLite with PHP and I want to know if my query failed or not.
Does query return FALSE in a case of a failure?
If it's a true failure - throw an exception.
If you expect the failure - returning null
is what's done usually.
Read the manual on sqllite_query:
This function will return a result handle or FALSE on failure. For queries that return rows, the result handle can then be used with functions such as sqlite_fetch_array() and sqlite_seek().
Regardless of the query type, this function will return FALSE if the query failed.
The documentation for sqlite_query()
says:
This function will return a result handle or FALSE on failure.