Sparrow Posted July 31, 2008 Share Posted July 31, 2008 Okay On my website I have a members table that automatically updates itself. Now I want to split this table into different sections based upon what members have entered in their "hub" field on the msql database table. For example: I need a mysql query that will bring up only users who have "Los Angles International" in thier "hub" column So I guess the query would start off like this: SELECT * FROM users... then what? Quote Link to comment Share on other sites More sharing options...
akitchin Posted July 31, 2008 Share Posted July 31, 2008 this involves the use of a simple WHERE clause: SELECT stuff FROM table WHERE column='the column value' have a look in the MySQL manual for more about the WHERE clause. Quote Link to comment Share on other sites More sharing options...
Sparrow Posted July 31, 2008 Author Share Posted July 31, 2008 Thank you. So I assume it would be in my case: SELECT * FROM users WHERE hub=Los Angles International. I'll have to test it Quote Link to comment Share on other sites More sharing options...
akitchin Posted July 31, 2008 Share Posted July 31, 2008 no - you need to add single quotes around 'Los Angeles International' since it is a string. before delving into writing this stuff, perhaps an intro tutorial on writing queries would be helpful. it will save you a fair bit of time in the end. Quote Link to comment Share on other sites More sharing options...
Sparrow Posted August 1, 2008 Author Share Posted August 1, 2008 Okay Thank you. I tested it in PHPMyadmin and it worked. If I need additional help in the future I'll come back here. 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.