All help topics · Link to this topic
Showing help on 'sqlite_query()'
Syntax: sqlite_query(INT <database handle>, STR <database query>[, INT <show columns>]) => [LIST or STR]This function will attempt to execute the query given in <query> on the database referred to by <handle>. The programmer must be a wizard, or E_PERM is raised.
On success, this function will return a list identifying the returned rows. If the query didn't return rows but was successful, an empty list is returned.
If the query fails, a string will be returned identifying the SQLite error message. If <handle> is invalid, E_INVARG is returned.
If <show columns> is true, the return list will include the name of the column before its results.
WARNING: sqlite_query does NOT use prepared statements and should NOT be used on queries that contain user input.