11-11-2015, 02:50 PM
Yes, pquery is "prepared query"
The idea of a prepared query is that you put question marks where you need values and then give it an array of values. The function will take care of doing any magic that is needed to safely setup an SQL command.
For example,
will end up with this SQL:
if there were more than one question mark they would get substituted in order and safely.
If you read the SQL you will see that only ONE invoice will be returned, the one with invoiceid=22, if it exists.
To get them all you would do:
The idea of a prepared query is that you put question marks where you need values and then give it an array of values. The function will take care of doing any magic that is needed to safely setup an SQL command.
For example,
Code:
$adb->pquery('select subject from vtiger_invoice where invoiceid=?',array(22));
will end up with this SQL:
Code:
select subject from vtiger_invoice where invoiceid=22
if there were more than one question mark they would get substituted in order and safely.
If you read the SQL you will see that only ONE invoice will be returned, the one with invoiceid=22, if it exists.
To get them all you would do:
Code:
$adb->pquery('select * from vtiger_invoice',array());
Joe
TSolucio
TSolucio