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 revisionPrevious revision
v5:userguide:portable_sql [2018/07/01 23:33] – prefer functions start lowercase (#430) peterddv5:userguide:portable_sql [2020/12/30 21:32] (current) – [Prepare/Execute] fix obvious variable case typos peterdd
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.txt · Last modified: 2020/12/30 21:32 by peterdd