oop - PHP - PDO placeholder with table.column format -


i created function preparevalue() takes array formatted $column => $value, , replaces each value ? whilst preserving copy of original array binding , executing later pdo.

this works fine queries following

$a = [ 'company' => 'apple' 'item' => 'ipad' ];  preparevalue($a);  $sql = 'where company = ? , item = ?'; prepare($sql); execute($a); 

however, required write queries array value table.column type value, pdo doesnt seem being substituted placeholder.

$a = [ 'companyid' => 'itemid'; ]  preparevalue($a);  $sql = 'where companyid = ?'; prepare($sql); execute($a); 

this query not work, if replace ? manually itemid following

where companyid = itemid 

the query works fine.

what best in scenario this? perhaps there way prepare table.column type values?


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -