Differences

This shows you the differences between two versions of the page.

Link to this comparison view

getaccountbyname [2013/01/21 12:44] (current)
Line 1: Line 1:
 +====== Get a Single Account By Name ======
  
 +===== Usage =====
 +
 +
 +==== Examples ====
 +
 +
 + $Account = $QB->getAccountByName("Accounts Payable");
 + echo $Account->Balance;
 +
 +==== Parameters ====
 +
 +  * $name  -- The desired account's Name. Must be exact match.
 +
 +
 +==== Returns ====
 +
 +  * FALSE if account wasn't found.
 +
 +  * Otherwise returns first row found in database as Database Object.
 +
 +
 +
 +
 +===== Source =====
 +
 + public function getAccountByName($name)
 + {
 + $this->DB->query("SELECT * FROM qb_account WHERE Name = '".$this->DB->prep($name)."';");
 + return $this->DB->pop();
 + }
getaccountbyname.txt · Last modified: 2013/01/21 12:44 (external edit)