Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the $adb object
#3
a few pointers:

  • pquery is more secure than query, pquery substitutes question marks for values, in general use pquery where you can
Code:
$rs = $adb->pquery('select subject from vtiger_invoice where invoiceid=?',array(22));
  • query_result returns one row and one column
Code:
$val = $adb->query_result($rs,row,column);
  • num_rows gives you the amount of rows returned in a result
Code:
$nrows = $adb->num_rows($rs);
  • to iterate over a set of rows you use a loop. you can do that with a "for" and num_rows, but I prefer a while, like this:
Code:
while ($row = $adb->fetch_array($rs)) {
$col1 = $row['column1'];
$col2 = $row['column2'];
....
}
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: 1 Guest(s)