Query Helpers
The benifit of these helpers are the inserts and updates are all excaped to limit errors on the database side.
Debug SQL: debug_sql(sql Var) Validate SQL: validate_sql(sql Var) returns bool
Count Functions
Count All: count_all("test_table") Builds: select count(*) as count_all from [test_table] Count Where: count_where("test_table", array("field1","value","field2",12)) Builds: select count(*) as count_all from [test_table] where field1 = 'value' and field2 = '12' Count Sql: count_sql("sql") Return an Integer: 23
Select Functions
Select All: select_all("test_table") Builds: select * from test_table Get Single Value from a Table get_single_value(table,db,field,where) Create an Array from a Select Statement: create_sql_array(sql, order, db, please_select)
Insert Functions
Insert: insert("test_table", array("field1","value with ' single quote","field2",12)) Builds: insert into [test_table] ([field1], [field2]) values ( 'value with '' single quote' , 12)
Update Functions
Update: Update("test_table", array("field1","value with ' single quote","field2",12), array("ID",12)) Builds: update [test_table] set [field1] = 'value with '' single quote' , [field2] = 12 where ID = '12'
Delete Functions
delete: delete(array("test_table",array("ID",12)) Builds: delete from [test_table] where ID = '12'