Jim Lucas <[EMAIL PROTECTED]> wrote in message
> Here are a few pointers to make it run just a little faster also.
> don't extract the entire $GLOBALS array.  just use the $var that you need.
> function GetData($Query)
> {
>     return(mysql_query($Query, $GLOBALS[db_conn]));
> }

The problem with this approach is that I do not know ahead of time which
I will need (other than $db_conn).  For instance, once query may depend of
the $ClassID
and $Attendance variables while another depends on the $StudentID and $Grade

> why are you using a define to set an SQL query string?

I am using define to set SQL query strings because there are a limited
number (30 or so)
of queries used by the application, but they are used in different contexts.
So, for example,
I may have:

 "SELECT FirstName, LastName, Grade, Attendance FROM Students, Classes
WHERE Students.StudentID = Classes.StudentID AND ClassID = $Class"

defined as StudentsByClass.  I can then pass the function the constant and
use it in
different situations.  For example:


will print a menu of student names whereas:


would print an attendance report


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to