Deanznet Posted March 26, 2010 Share Posted March 26, 2010 First Question I have a database setup Id Item Cat1 Cat2 2 Shirt offroad gloves Something along those lines Now i want to be able to have 2 select boxes like this and when you click on the second one it will automatically search the Mysql records something that has offroad in cat1 and what ever you select in the other box for cat2 Help Please? Ha Here is my second question. a little different db setup Id Item Cat1 Cat2 cost retail 2 Shirt offroad gloves $1.99 Now i have php page i made to add this but i want to say lets if im putting the item in the glove category i would want to add 20% to the 1.99 and put that in the retail row but if i stock it in maybe the hat category i might want to add 40% understand? Any idea how? Quote Link to comment https://forums.phpfreaks.com/topic/196559-2-questions-dealing-with-mysql-almost-done-please-help/ Share on other sites More sharing options...
Brandon_R Posted March 26, 2010 Share Posted March 26, 2010 You would need to use javascript/ajax to perform the search and return the results in a div id. Assign some keywords to the catgory 1 select menu and when clicked on it searches the database for the keywords ie in your case glove, and returns the results in the div id you specify. Quote Link to comment https://forums.phpfreaks.com/topic/196559-2-questions-dealing-with-mysql-almost-done-please-help/#findComment-1032013 Share on other sites More sharing options...
Deanznet Posted March 26, 2010 Author Share Posted March 26, 2010 Thanks! Got it working with this tutorial here: w-w-w.w3schools.com/PHP/php_ajax_database.asp But i just cant figure out to add a second query. Quote Link to comment https://forums.phpfreaks.com/topic/196559-2-questions-dealing-with-mysql-almost-done-please-help/#findComment-1032032 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.