ricmetal Posted November 5, 2011 Share Posted November 5, 2011 hiyas i need some help in creating a mysql query. i have four groups of options, and upon a selection of one option per group, i need to have a single mysql query to accomodate this, so how would i go about doing this without going into a dozen if's and else's? is it possible? regardos Quote Link to comment Share on other sites More sharing options...
joel24 Posted November 6, 2011 Share Posted November 6, 2011 not entirely sure exactly what you're after...? $radio1=(isset($_POST['radioButton1']) )?$_POST['radioButton1']:''; $radio2=(isset($_POST['radioButton2']) )?$_POST['radioButton2']:''; $radio3=(isset($_POST['radioButton3']) )?$_POST['radioButton3']:''; $sql=@mysql_query("UPDATE table SET radio1='$radio1', radio2='$radio2', radio3='$radio3' WHERE id='$id'"); Quote Link to comment Share on other sites More sharing options...
ricmetal Posted November 6, 2011 Author Share Posted November 6, 2011 what i need is to have a query that selects all entries based on a) all users OR b) one specific user, AND on a) all years OR b) one specific year AND a) all months OR b) one specific month AND a) oldest to new entries OR b) newest to old. the only problem i can find is that each group's default option ( a) ) is not found on the database Quote Link to comment Share on other sites More sharing options...
fenway Posted November 6, 2011 Share Posted November 6, 2011 What? Quote Link to comment Share on other sites More sharing options...
ricmetal Posted November 6, 2011 Author Share Posted November 6, 2011 nevermind Quote Link to comment Share on other sites More sharing options...
fenway Posted November 6, 2011 Share Posted November 6, 2011 nevermind If you have the solution, then post it. "nevermind" won't help anyone but you. Quote Link to comment 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.