hello,
I have code below.
I want to have a dropbox, and use the selection out of the dropbox for a second dropbox and exclude the first id out of the second dropbox. (select all players, and select all players without the first selection)
Any help for how to make the second query and include the selection from the dropbox?
I want to avoid going to the second page, and execute the query immediately after the selection is made.
[php]
<?php error_reporting(E_ALL); session_start(); include("menu.php");$mysqlserver = “localhost”;
$mysqlusername = “root”;
$mysqlpassword = “”;
$dbname = ‘biljart’;
$con = mysql_connect($mysqlserver, $mysqlusername, $mysqlpassword) or die ("Error connecting to mysql server: ".mysql_error());
mysql_select_db($dbname, $con)
or die ("Error selecting specified database on mysql server: ".mysql_error());
$query_beurt1 = “SELECT
id,
CONCAT(voornaam, ’ ', achternaam) as voornaam
FROM
leden
ORDER BY id”;
$result = mysql_query($query_beurt1,$con)
or die ("Query to get data from firsttable failed: ".mysql_error());
$count = 0;
$myresult = array();
$rows=mysql_num_rows($result);
while($count < $rows) {
$myresult[$count][“id”] = mysql_result($result,$count,“id”);
$myresult[$count][“voornaam”] = mysql_result($result,$count,“voornaam”);
$count++;
}
?>
<?php $voornaam = array(); foreach($myresult AS $value){ $voornaam[strtoupper($value["id"])] = strtoupper($value["voornaam"]); }foreach($voornaam AS $key => $value){
echo "<option value=\"".$key."\">".$value."</option>";
}
?>