mlotis Posted January 19, 2011 Share Posted January 19, 2011 So I'm creating a website for bar deals... I've tried for hours trying to get the url to take in more than one parameter with no luck, I don't know if my database isn't setup correctly or something but the url would look like this http://www.site.com/?id=1&day=Monday and when those parameters are passed the deals for that id and day are then posted in the content area I'm pretty much stumped. I feel like it's much easier than I am making it. My database looks like: ID Name Monday Tuesday Wednesday -> and so on 1 Bar1 MondayDeal TuesdayDeal WednesdayDeal 2 Bar2 MondayDeal -> and so on Quote Link to comment Share on other sites More sharing options...
Jocka Posted January 19, 2011 Share Posted January 19, 2011 let's assume the table is called "bar_table" (you didn't say) This should do it: $query = mysql_query("SELECT ". $_GET['day'] . " FROM bar_table WHERE id='".$_GET['id']."'"); Seems to be what your looking for. of course I'd be more secure with the query but thats the basic idea. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.