Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Queries Take forever w/ PHPSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v7 Forum

 New Topic 
 
 Post Reply 
[1]  
 Queries Take forever w/ PHP 
 Author   Message 
  Nicholas Henry 
  
 Group: Members 
 Posts: 7 
 Joined: 2007-06-12 
 Profile
 Posted : 2007-06-12 08:10:15
We would like to use PHP to access our Company File, but queries take 2X+ the time that they do w/ Access or Excel.  Some even timeout they take so long.  Is there any reason why the same query would take so much longer using PHP?  Is there any way to speed it up?

(tried with % instead of * in the Like Clauses as well, still fails w/ php but works fine in Excel)
$sSQL = "SELECT PurchaseOrderLineItemRefFullName, VendorRefFullName, TxnDate, TermsRefFullName, ExpectedDate, PurchaseOrderLineAmount
         FROM PurchaseOrderLine
         WHERE (PurchaseOrderLineItemRefFullName Like '*CUPPER*') AND (PurchaseOrderLineCustomerRefFullName Like '*OCS2*')
         ORDER BY TxnDate"; 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-06-12 09:10:29

PHP is calling a Windows Service which requires multple reconnections to QuickBooks as the service thread changes. This slows things down. Apart for the obvious, don't scan the whole table for results by using a date range instead and you can force the query to use the optimized table only by doing:

$sSQL = "SELECT PurchaseOrderLineItemRefFullName, VendorRefFullName, TxnDate, TermsRefFullName, ExpectedDate, PurchaseOrderLineAmount
         FROM PurchaseOrderLine NOSYNC
         WHERE (TxnDate >= {d'2007-01-01'})
        AND (PurchaseOrderLineItemRefFullName Like '*CUPPER*')
        AND (PurchaseOrderLineCustomerRefFullName Like '*OCS2*')
         ORDER BY TxnDate"; 

 

 

  Top 
  Nicholas Henry 
  
 Group: Members 
 Posts: 7 
 Joined: 2007-06-12 
 Profile
 Posted : 2007-06-13 00:12:45
thanks for the help, I'll give that a try.  I'm very new to using PHP to access QB, do you know of any good tutorials?  All I've really found is DisplaySQL.php and TestConnection.php.  Any advice would be appreciated.
 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to