Click to See Complete Forum and Search --> : Number of queries withen a single page


macgilli
05-03-2001, 06:22 AM
Hello. I've searched through the archives but to no avail (mostly because I don't know what it is called that I am searching for).

Setup: PHP3 on Apache running on a Windows NT box connecting to an Access 97 database through an odbc connection.

Problem: It's a timesheet utility that is working fine for the most part. There is a dynamic form which lists the projects that an employee is able to charge time to, with a row of textboxes representing sun to sat in which the employee enters their time. When the user is about to save their time, I have a little routine which steps through each row and runs an insert sql for each day. This works fine. The page then reloads showing the textboxes with the newly saved data. If there are too many projects, the SELECT sql's to get the data to place in the textboxes start to fail (ie the "if ($result2 = odbc_Exec($conn, $sqlstr2))" statement returns false).

My question is if there is a maximum number of queries can be run on a single connection, and what is this called, and where do I up the default limit.

Any insight would be greatly appreciated.
Aaron MacGillivary

vincente
05-03-2001, 06:37 AM
There shouldn't be a limit on how many queries you can run on a single connection, but there is a limit on how many queries you can run before being declared not smart.

what is your database setup like?

macgilli
05-04-2001, 12:38 PM
I set the utlility up awhile ago, and once I got things working, I never went back and optimized the code, so it was admitably sloppy. I have gone back and using some arrays, have eliminated the need for the multiple calls to the db.

The database setup is quite simple. Table of projects, table of employees, table of holidays, table of relationship between supervisor and employee, table of eligible projects for employees, a table of employee unsubmitted time, a table of time submitted and awaiting approval, and a table of approved time.

The odbc error logged was:
PHP 3 Warning: SQL error: [Microsoft][ODBC Microsoft Access 97 Driver] Can't open any more databases., SQL state S1000 in SQLExecDirect in d:\www\htdocs\timesheets\timeentry.php on line 526