ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:portable_sql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
v5:userguide:portable_sql [2018/07/01 23:33]
peterdd prefer functions start lowercase (#430)
v5:userguide:portable_sql [2020/12/30 21:32] (current)
peterdd [Prepare/Execute] fix obvious variable case typos
Line 126: Line 126:
 */ */
  
-$sql = 'insert into table (col1,col2) values ('.$DB->Param('a').','.$DB->Param('b').')';+$sql = 'insert into table (col1,col2) values ('.$db->param('a').','.$db->param('b').')';
 # generates 'insert into table (col1,col2) values (?,?)' # generates 'insert into table (col1,col2) values (?,?)'
 # or        'insert into table (col1,col2) values (:a,:b)' # or        'insert into table (col1,col2) values (:a,:b)'
-$stmt = $DB->prepare($sql); +$stmt = $db->prepare($sql); 
-$stmt = $DB->execute($stmt,array('one','two'));+$stmt = $db->execute($stmt, array('one','two'));
  
 </code> </code>
v5/userguide/portable_sql.1530480824.txt.gz · Last modified: 2018/07/01 23:33 by peterdd