MongoosePeople. Places. Questionable inventions.

All help topics · Link to this topic

Showing help on 'sqlite_execute()'

Syntax: sqlite_execute(INT <database handle>, STR <SQL prepared statement query>, LIST <values>) => [LIST or STR]

This function will attempt to create and execute the prepared statement query given in <query> on the database referred to by <handle> with the values <values>. 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.

sqlite_execute uses prepared statements, so it's the preferred function to use for security and performance reasons.

Example:
sqlite_execute(0, "INSERT INTO users VALUES (?, ?, ?);", {#7, "lisdude", "Albori Sninvel"})