#VARS
?: = database prefix
?i = int
?s = string
?l = like ex: LIKE ?l => '%HERE'
?n = numeric ex: IN (?n) => array(1,2,3)
?a = string ex: IN (?a) => array('a','b','c')
#INSERT
$vars = array(
'name'=>'value',
'subname'=> $value
);
$inserted_id = db_query('INSERT INTO ?:table ?e', $vars);
#UPDATE
$id = 1;
$vars = array(
'name'=>'value',
'subname'=> $value
);
db_query('UPDATE ?:table SET ?u WHERE id=?i', $vars, $id);
#DELETE
db_query('DELETE FROM ?:table WHERE id=?i', $id);
2 Responses
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.