hookit Posted August 10, 2009 Share Posted August 10, 2009 Hi, I have a bd with the following fields: Id, state, town, address, day Primary key: id Each field, except id, should has a text field in the php form. Blank inputs are allowed in the form. The search should return the registries that match the inputs in the search. Combining 1 or 2 or 3 fields or alltogether. Can it be done with php?, cause i have been told in a Mysql forum that is better done with php. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/169620-searching-form/ Share on other sites More sharing options...
Maq Posted August 10, 2009 Share Posted August 10, 2009 Can it be done with php?, Yes. What part are you having trouble with? I'm not sure exactly what you're trying to ask because I don't see any other questions... cause i have been told in a Mysql forum that is better done with php. As opposed to? Quote Link to comment https://forums.phpfreaks.com/topic/169620-searching-form/#findComment-894878 Share on other sites More sharing options...
phporcaffeine Posted August 10, 2009 Share Posted August 10, 2009 SELECT * WHERE state LIKE '%" . $_POST['state'] . "%' AND town LIKE '%" . $_POST['town'] . "%', address LIKE '%" . $_POST['address'] . "%' AND day LIKE '%" . $_POST['day'] . "%' .... etc Something like that? Quote Link to comment https://forums.phpfreaks.com/topic/169620-searching-form/#findComment-894879 Share on other sites More sharing options...
jarvis Posted August 10, 2009 Share Posted August 10, 2009 Hi hookit, Are you trying to add data into the table but you want to check whether those fields are already used to prevent duplicate entries Each field, except id, should has a text field in the php form. or are youyou trying to search those fields? search should return the registries that match the inputs in the search Quote Link to comment https://forums.phpfreaks.com/topic/169620-searching-form/#findComment-894882 Share on other sites More sharing options...
hookit Posted August 10, 2009 Author Share Posted August 10, 2009 Hi Jarvis Im trying to make a search. thanks Quote Link to comment https://forums.phpfreaks.com/topic/169620-searching-form/#findComment-895059 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.