galvin Posted February 17, 2010 Share Posted February 17, 2010 Say I have 4 entries in MYSQL and they have the following "poolid"... 3471 3472 3473 3474 How can I write a query to look for any poolids that start with "347"? (therefore, bringing back these four poolids) The basic query is below, but how can I make that say (in plain english) "Select * FROM pools where the poolid starts with '347'? $sql = "SELECT * FROM pools WHERE poolid = '347'"; Quote Link to comment https://forums.phpfreaks.com/topic/192337-grabbing-partial-string-from-database-in-query/ Share on other sites More sharing options...
mapleleaf Posted February 17, 2010 Share Posted February 17, 2010 $sql = "SELECT * FROM pools WHERE poolid like '347%'"; Quote Link to comment https://forums.phpfreaks.com/topic/192337-grabbing-partial-string-from-database-in-query/#findComment-1013546 Share on other sites More sharing options...
galvin Posted February 17, 2010 Author Share Posted February 17, 2010 thank you! Quote Link to comment https://forums.phpfreaks.com/topic/192337-grabbing-partial-string-from-database-in-query/#findComment-1013559 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.