View Full Version : Quick Question
Romanity
04-01-2007, 08:29 PM
If i had a box in which you could select multiple answers... not the check boxes but a multiple drop down thingy if you know what i mean.
For the array of the options they choose or w.e
Would i do it as
$group = array($_POST[group]);
Or is it more complex?
and then to select the users to send it
("SELECT * FROM `users` WHERE `level` = '$group'");
Would that all work?
Dentafrice1
05-01-2007, 12:24 AM
Hmm i wondered this too.. I know how to do multiple checkboxes but im not sure about that one.
maybe a foreach?
Romanity
05-01-2007, 04:10 PM
mmmm... Ill try it, otherwise ill look it up on php.net or something.
You mean a options thing for all the groups?
Just repeat it..
<?
echo "<select size='1' name='group'>";
$result = mysql_query("SELECT * FROM `groups`");
while($group= mysql_fetch_array($result)) {
$group = $sql["NAMEORWHATEVERDEFINESTHEUSERGROUPNAME"];
echo "<option value=$group>$group</option>";
}
echo "</select>";
?>
Then you would use
$query = mysql_query("INSERT INTO `WHATEVER` ( `WHATEVER`) VALUES ('WHATEVER')");
Edit: If thats not what ur looking for, tell me and I will try to help again.
Romanity
05-01-2007, 04:19 PM
Not like a normal drop down, you know one where you can select multiple options...
Not like a normal drop down, you know one where you can select multiple options...
Dunno that code sorry.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.