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
Next revision
Previous revision
v5:userguide:portable_sql [2018/06/27 16:14] – start functions lowercase #430 dregadv5: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>
Line 174: Line 174:
   AGE N(16) DEFAULT 0   AGE N(16) DEFAULT 0
 "; ";
-$sql1 = $datadict->CreateTableSQL('tabname', $flds); +$sql1 = $datadict->createTableSQL('tabname', $flds); 
-$sql2 = $datadict->CreateIndexSQL('idx_name_age', 'tabname', 'NAME,AGE');+$sql2 = $datadict->createIndexSQL('idx_name_age', 'tabname', 'NAME,AGE');
  
 </code> </code>
v5/userguide/portable_sql.txt · Last modified: 2020/12/30 21:32 by peterdd