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'"; 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%'"; 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! 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
Archived
This topic is now archived and is closed to further replies.