Re: Friday morning brain farts....
| From: | Stut | Date: | Fri, 10 Aug 2007 15:16:23 +0000 |
| Subject: | Re: Friday morning brain farts.... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260585@lists.php.net to get a copy of this message | ||
Daniel Brown wrote:
On 8/10/07, Jason Pruim <japruim@raoset.com> wrote:Bad Dan *slap*. Ignoring notices may be detrimental to your health and/or well-being. Better to initialise it with a default if it has not been set in the request. if (!isset($_GET['order'])) $_GET['order'] = 'Last'; -Stut -- http://stut.net/Hi All :) Hope you're not getting sick of my questions as of late, but I keep getting closer and closer and thank you all who have helped me in the past! "The only reason I can see this far is I am standing on the shoulders of giants" don't know who said that but I like it :) Anyway... Onto the question... I think I'm just going crazy as it's been a busy week for me, but I can't figure out how to do this. What I am attempting to do is, I have a webpage(Don't we all?) that calls info to be displayed from a database, I want to be able to sort that info so my sql query looks like: "Select * from current order by '$order';" and $order is populated by a GET when they click on a link: "<A href=index.php?order='Last'>Sort by last name</A>" Now... the whole PHP page is being included in a .shtml page to actually display it and make it look purrdee :) How do I get it to resort the info and include the new sort on the page? I'm not sure if this has anything to do with it but: $order = $_GET['order']; <------Line 6 [Fri Aug 10 10:42:04 2007] [error] PHP Notice: Undefined index: order in /Volumes/RAIDer/webserver/Documents/tests/legion/index.php on line 6 Any help will be greatly appreciated.. And if it solves the problem I'll name some of my kids* after you! *Subject to approval of the Wife :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.comRemember to clean that input before you sit down at the table, there, boy!It's safe to ignore theappear if a variable is referenced without first being instantiated or defined. No biggie, just put this at the head of your code: ini_set("error_reporting",E_ALL & ~E_NOTICE);Undefined indexnotices. That will just