Parsing paramaters of an object back to itself
Posted: Mon Oct 23, 2006 6:41 am
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.
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.