Menu

Using the Database Log in to Edit

Andrew Burleson

Referencing to the pal_db object

The palette class holds an instance of the pal_db class. To use it, use $palette->db. Remember that when using this in functions, you must use global $palette at the beginning of the function.

The syntax of the query function

Every query is done with the pal_db::query() function. The general syntax is :

($q,$imode=PAL_DB_I_NONE,$omode=false,$data=null,$fetchmode=PDO::FETCH_ASSOC)

The first parameter is the query, and it is the only required parameter. You can use it in that form for things like CREATE TABLE queries. The second parameter is the input mode and is either PAL_DB_I_NONE (for no input), PAL_DB_I_SINGLE (for a single set of input) or PAL_DB_I_MULTI (for multiple sets of input). The third parameter is the output mode and is either true (give me output) or false (I don't need output). The fourth parameter is your actual input data and the fifth parameter is the fetchmode.

Getting the last inserted ID

use lastID();


Discussion

Anonymous
Anonymous

Add attachments
Cancel