phpLens
 home  products examples manual  faq support forum  contact news  login store

Forums: phplens   adodb
Forums:   PHPLens Technical Support:   Replies 
New ReplySearch
Topic: bind placeholders
author: Roman Toengi   created: 16-07-2010 10:24:28 AM
Hi

Is there a way to use bind placeholders also for table names and for column names?

$sql = 'insert into '.$DB->Param('a').' (col1) values ('.$DB->Param('b').')';
$stmt = $DB->Prepare($sql);
$stmt = $DB->Execute($stmt,array('table','value'));

The above code will generate an sql such as this:
insert into 'table' (col1) values ('value')

The embracing apostrophes of 'table' causes an error.

Any ideas?
Thanks in advance
Page 1
New ReplySearch

View Source

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800