tascam424 Posted January 5, 2014 Share Posted January 5, 2014 So i'm running a fairly simple myslqi select like so : $result = mysqli_query($con,"SELECT DISTINCT DiscNo, Description FROM cdg ORDER BY DiscNo"); What i would like to do is alter it slightly to add in a WHERE clause where Description CONTAINS the value from a drop down. So basically the first thing i need is a mysqli_query like so : $result = mysqli_query($con,"SELECT DISTINCT Description FROM cdg ORDER BY Description"); But i need the results of this to display in a DropDown list, then based on the selection, propogate my first query like this : $result = mysqli_query($con,"SELECT DISTINCT DiscNo, Description FROM cdg WHERE Description CONTAINS (dropdownselectvalue) ORDER BY DiscNo"); I hope this makes sense, i kinda know what i want to do, but i just don't know how to do it .. Any help would be greatly apreciated ! Quote Link to comment https://forums.phpfreaks.com/topic/285115-mysqli_select-with-drop-down/ Share on other sites More sharing options...
Barand Posted January 5, 2014 Share Posted January 5, 2014 The usual way to do CONTAINS is WHERE Description LIKE '%dropdownselectvalue%' Quote Link to comment https://forums.phpfreaks.com/topic/285115-mysqli_select-with-drop-down/#findComment-1463970 Share on other sites More sharing options...
tascam424 Posted January 5, 2014 Author Share Posted January 5, 2014 Thanks for that .. Any direction on how i tie the dropdown value into the SELECT ? I am a total novice !! Quote Link to comment https://forums.phpfreaks.com/topic/285115-mysqli_select-with-drop-down/#findComment-1463971 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.