I have a field in my database which holds values seperated by ,'s
for example: 3,4,4.5,5,6,7.5
I want the user to chose a value from a list and see if that value is held in the field. for example 4.5
Can i use a wild card expression. I tried this but it returned nothing
$resultID = mysql_query("SELECT * FROM tblShoestest where fitting LIKE '$width' AND SizeRange1 LIKE '*$size*'", $linkID)or die(mysql_error());
any help appreciated
can i use wild cards in a select statment [SOLVED]
Moderator: General Moderators
-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester
can i use wild cards in a select statment [SOLVED]
Last edited by nutstretch on Tue Feb 10, 2004 4:35 am, edited 1 time in total.
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
Last edited by malcolmboston on Tue Feb 10, 2004 4:31 am, edited 1 time in total.
for wildcards, use percentage signs instead of asterix
Mark
Code: Select all
$resultID = mysql_query("SELECT * FROM tblShoestest where fitting LIKE '$width' AND SizeRange1 LIKE '%$size%'", $linkID)or die(mysql_error());-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester