Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the $adb object
#5
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,

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
Reply


Messages In This Thread
Using the $adb object - Guido1982 - 11-10-2015, 05:33 PM
RE: Using the $adb object - Guido1982 - 11-10-2015, 08:11 PM
RE: Using the $adb object - joebordes - 11-10-2015, 10:12 PM
RE: Using the $adb object - Guido1982 - 11-11-2015, 10:47 AM
RE: Using the $adb object - joebordes - 11-11-2015, 02:50 PM
RE: Using the $adb object - Guido1982 - 11-11-2015, 03:46 PM
RE: Using the $adb object - joebordes - 11-11-2015, 10:09 PM
RE: Using the $adb object - Guido1982 - 11-11-2015, 10:15 PM
RE: Using the $adb object - joebordes - 11-11-2015, 11:00 PM
RE: Using the $adb object - Guido1982 - 11-11-2015, 11:49 PM
RE: Using the $adb object - joebordes - 11-12-2015, 07:26 AM
RE: Using the $adb object - Guido1982 - 11-12-2015, 07:14 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)