Woodburn2006 Posted December 8, 2007 Share Posted December 8, 2007 i used a php form to put data into a DB table. 1 of the columns data is a list like: cd,radio,tv how do i select the records that just say CD? i have tried: $sql_1cd = "SELECT * FROM dissertation WHERE q1 = '%cd%'"; but it returns no results when i know there are fields containing CD Link to comment https://forums.phpfreaks.com/topic/80783-sql-where-clause/ Share on other sites More sharing options...
Barand Posted December 8, 2007 Share Posted December 8, 2007 2 mistakes 1 ) WHERE q1 LIKE '%cd%' 2 ) Not normalising the data in the first place Link to comment https://forums.phpfreaks.com/topic/80783-sql-where-clause/#findComment-409755 Share on other sites More sharing options...
Woodburn2006 Posted December 8, 2007 Author Share Posted December 8, 2007 yeh i know i isnt normalised but it was set up in about 5 minutes cos its a questionnaire for uni work thanks Link to comment https://forums.phpfreaks.com/topic/80783-sql-where-clause/#findComment-409796 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.