including functions, passing objects I created

From: Date: Wed, 12 Jun 2002 20:59:39 +0000
Subject: including functions, passing objects I created
Groups: php.general 
Request: Send a blank email to php-general+get-101815@lists.php.net to get a copy of this message
I have a line class that I'm using to draw a line graph of up to 5 lines. Since I query the db for each of those lines (with a # as lineNum), my code to take everything out of the fetch_arrays is fairly cumbersome. I use this code in 4 different programs (the graph, the printable graph, the data table, and the accessible [D]). To avoid code duplication, I'd really like to be able to pass $sql and the 5 lines to a function in a different file, that all 4 of my programs can use. I have tried both function runSQL ($sql, &$line1, &$line2...) { ... } and function runSQL ($sql, $line1, $line2...) { ... return array ($line1, $line2...); } but both ways timeout. Is there any way for me to put data into my line objects from a function? I know that the include is working because I have a test function that just prints out "Hello". I've checked the manual, but it doesn't say anything about having a user-made object as a param or a return. Thanks for any info you may have! -Natalie Natalie S. Leotta Information Management Services, Inc. (301) 680-9770 LeottaN@ims.nci.nih.gov

« previous php.general (#101815) next »