Field Type
name varchar(50)
setting varchar(50)
userid int(11)
value text
Now im trying to get the userid from the database where the name = name and setting = month the value = 6 and the setting = day and the value = 7
in the field "setting" there are various data name 2 of them are called day and month and basically im trying to get the userid number from the database where day = today and month = this month ive tried this and a few other ways but they dont work :(
Expand|Select|Wrap|Line Numbers
- $day = date("j");
- $month = date("n");
- $sql = "(SELECT userid FROM " .tablename. " WHERE name = 'addon' AND setting = 'day' AND value = $day) UNION (SELECT userid FROM " .tablename. " WHERE name = 'addon' AND setting = 'month' AND value = $month)";
- $result = db_query($sql);
- $row = db_fetch_assoc($result);