Ok so I've created a results.php object which accepts the following paramaters:
1. an array of Titles for each column of the results
2. an array of column names of each column of the database
3. an sql query
4. a database connection.
When I try to click "NEXT" to see the results on the next page, I some errors including these:
Notice: Undefined index: 2 in D:\XXXXX\Web_Pages\Object_Library\Result_Fields\results.php on line 103
Notice: Trying to get property of non-object in D:\XXXXX\Web_Pages\Object_Library\Result_Fields\results.php on line 122
Basically, its looking for the above paramaters which (obviously) arent there when I re-call the current web page whilst modifying the paramaters in the $_GET array.
Yes, I realise I could just create each of the above paramaters and set them in stone in the results.php file, but that would mean for each set of results I display which take a different query, I would have all that code duplicated....sounds like bad programming in my book!
Is there a way, I can re-call the current PHP file using the same objects/paramaters parsed to the current file; whilst modifying the paramaters in the url (ie. in the $_GET array)???
Thanks.
Parsing paramaters of an object back to itself
Moderator: General Moderators
Re: Parsing paramaters of an object back to itself
This means a "next" link in a browser, i.e. a new http request? If so then it is handled by a new instance of your script, an object of a previous instance is gone. When this single request is done all objects, resources etc will be destroyed and another request will be handled again by new instance of the script.mcccy005 wrote:When I try to click "NEXT" to see the results on the next page
You may store some data as session data, see http://de2.php.net/session