I understand that sqlite_exec is for queries that does not return result set and sqlite_query is for queries that return result set.
However can I use sqlite_query for all kinds of queries just like how mysql_query and are there any side effects to this?
sqlite_query
sqlite_exec
I don’t think there will be that much difference between always using sqlite_query, although you may lose some clock cycles while sqlite_query is figuring out that there are no results. Both functions return FALSE on failure, so as long as you always check for FALSE rather than TRUE you might be able to get away with it.
You may also want to look at sqlite_unbuffered_query if you are doing straightforward PHP database work, sequentially iterating through results from the query.
I checked the C API for this and it doesn’t give any indication of a performance penalty for using one function over the other.