tags:

views:

23

answers:

3

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?

A: 

If it's a true failure - throw an exception.

If you expect the failure - returning null is what's done usually.

Emil Ivanov
A: 

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.

Tatu Ulmanen
A: 

The documentation for sqlite_query() says:

This function will return a result handle or FALSE on failure.

Ignacio Vazquez-Abrams