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 Link to comment https://forums.phpfreaks.com/topic/250534-need-help-with-mysql-design/ 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'"); Link to comment https://forums.phpfreaks.com/topic/250534-need-help-with-mysql-design/#findComment-1285438 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 Link to comment https://forums.phpfreaks.com/topic/250534-need-help-with-mysql-design/#findComment-1285500 Share on other sites More sharing options...
fenway Posted November 6, 2011 Share Posted November 6, 2011 What? Link to comment https://forums.phpfreaks.com/topic/250534-need-help-with-mysql-design/#findComment-1285505 Share on other sites More sharing options...
ricmetal Posted November 6, 2011 Author Share Posted November 6, 2011 nevermind Link to comment https://forums.phpfreaks.com/topic/250534-need-help-with-mysql-design/#findComment-1285508 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. Link to comment https://forums.phpfreaks.com/topic/250534-need-help-with-mysql-design/#findComment-1285509 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.