Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the $adb object
#1
Okay, so I've spent a couple of hours reading the entire PearDatabase file, and have two conclusions:

- Having learned a lot about PHP the last year, I still need more knowledge.
- The $adb is the system-wide used instance of the PearDatabase class, so all object methods live there through which you can communicate with the database.

Digging further into the method use of $adb, I found this example:

Code:
// Extra function to create unique invoice_number
function getInvoiceNumber() {
global $adb;
$sql="select max(subject) as aantal from vtiger_invoice where
Year(invoicedate) = year(now())";
$result = $adb->query($sql);
$invoice_subject= $adb->query_result($result,0,"aantal");

So basically the two most basic methods are 'query' in which you perform a query, and 'query_results', that'll give you an array with results. If anyone knows more good reading sources about this, please reply with links so I can learn more about his object, since it clearly seems to be one of the most important ones of the system.
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: 2 Guest(s)