kemper Posted December 19, 2006 Author Share Posted December 19, 2006 OK, I changed the $result line as you suggested.Now, my results are all ages, instead of the selected ages (www.mysite.com/view.php?ages=7)Any suggestions? Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 19, 2006 Share Posted December 19, 2006 Do you have a WHERE age='$age' clause in your query? Quote Link to comment Share on other sites More sharing options...
kemper Posted December 19, 2006 Author Share Posted December 19, 2006 No, I do not. Someone here got me started with this script. I do not know too much about this stuff yet and assumed that the line given below did that.[code]$age = $_GET['age'];[/code]How do I put that in? Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 19, 2006 Share Posted December 19, 2006 The $_GET statement 'snags' the age from the url (ex: www.yoursite.com/view.php?age=7) and populates the variable name you've assigned to it which is $age. So...$age = $_GET['age']; snags the number 7 from the url and assigns that number as the value of $age. Now, you need to use that variable in your mysql query like this:$sql = "SELECT age, division, team FROM MyTable WHERE age='$age'";Note the $age variable is in the WHERE clause. So, say you had a link on your page for each age like 7, 6 , 10, etc. then the query would simply snag the age from the url and display all people/members/whatevertheyare that have that age. The 'WHERE' clause filters out all the other results since it's looking for everyone (in this case) that is the age of 7.Make sense? Quote Link to comment Share on other sites More sharing options...
kemper Posted December 19, 2006 Author Share Posted December 19, 2006 Hey, it works! I am still confused, but you have given me some great information.Now, I will dissect and manipulate it in hopes to become the guru of PHP and MySQL. Yeah right!Thanks! Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 19, 2006 Share Posted December 19, 2006 Well, if it's any inspiration to you... I didn't know up from scoot about 4 months ago. I practically lived here and read post after post learning all I could. Then I wrote 3 completely different styled scripts on my own with the help of these people that included everything from file uploading to IP banning. One was an entire website in PHP. It'll all make sense once you get the terminology down and the basic concepts of the core functions and database integration. There's a load of great great sites with tutorials with each explaining it in their own way. I read through dozens of those to find the ones that explained it the way I could understand it. So, check those out and you'll learn faster. Quote Link to comment Share on other sites More sharing options...
kemper Posted January 17, 2007 Author Share Posted January 17, 2007 Now, I want to allow changes to be made directly to the database and am not sure where to even start. Any suggestions? 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.