HAVOCWIZARD Posted June 18, 2007 Share Posted June 18, 2007 guys, after you have the result from the query how can you filter out on the specific result, let say i have all the peoples telephone number, how can i filter out now those that only live in my area ? Link to comment https://forums.phpfreaks.com/topic/56025-solved-just-a-quick-question/ Share on other sites More sharing options...
willpower Posted June 18, 2007 Share Posted June 18, 2007 this is done in your select statement ie SELECT * FROM 'telephone_dir' WHERE 'area'='myarea' you will need to be more specific about your table and fields before we can give a precise answer Link to comment https://forums.phpfreaks.com/topic/56025-solved-just-a-quick-question/#findComment-276679 Share on other sites More sharing options...
HAVOCWIZARD Posted June 18, 2007 Author Share Posted June 18, 2007 okey i understand that, i have the select all, but now i get all the info in that area, okey now i have my result off let say "bevery hills" now in that result i want to find all the numbers of ending with 5432, can i run a query on a query ?. Link to comment https://forums.phpfreaks.com/topic/56025-solved-just-a-quick-question/#findComment-276681 Share on other sites More sharing options...
aniesh82 Posted June 18, 2007 Share Posted June 18, 2007 Please go through the entire records and check using an if Example: $result=mysql_query("your query"); while($data=mysql_fetch_array($result)) { if($data['arae'] == "YourArea") $array[] = $data['telephoneNumber'] ; } print_r($array) has the list telephone number in your area. I think it is better to change the select query to select the telephone number in your area. Example: SELECT * FROM table WHERE area="YourArea" Link to comment https://forums.phpfreaks.com/topic/56025-solved-just-a-quick-question/#findComment-276682 Share on other sites More sharing options...
HAVOCWIZARD Posted June 18, 2007 Author Share Posted June 18, 2007 thanks will try that... Link to comment https://forums.phpfreaks.com/topic/56025-solved-just-a-quick-question/#findComment-276683 Share on other sites More sharing options...
aniesh82 Posted June 18, 2007 Share Posted June 18, 2007 Change your query like this : SELECT * FROM table WHERE area="YourArea" AND telephoneNumber LIKE '%5432' Link to comment https://forums.phpfreaks.com/topic/56025-solved-just-a-quick-question/#findComment-276687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.