Jump to content

need help with mysql design


ricmetal

Recommended Posts

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

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'");

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.