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? Link to comment https://forums.phpfreaks.com/topic/117632-solved-need-query/ 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. Link to comment https://forums.phpfreaks.com/topic/117632-solved-need-query/#findComment-605023 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 Link to comment https://forums.phpfreaks.com/topic/117632-solved-need-query/#findComment-605038 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. Link to comment https://forums.phpfreaks.com/topic/117632-solved-need-query/#findComment-605042 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. Link to comment https://forums.phpfreaks.com/topic/117632-solved-need-query/#findComment-605194 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.