11-10-2015, 10:12 PM
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
TSolucio