Location: PHPKode > projects > Decider > decider/Kp_Quiz/select_domainkp.php
<?php



 require("../common/database.php");
 if ( ! $link ) {
   die( "Couldn't connect to MySQL: ".mysql_error() ); }

if (isset($_GET['domain']) && $_GET['domain'] != '') {
	//Add slashes to any quotes to avoid SQL problems.
	$domain = addslashes($_GET['domain']);
	//Get every page title for the site.
	$result = mysql_query("SELECT * FROM key_person WHERE  Domain_Name='".$domain."'");
	echo "<option value=''>-select kp</option>";
	while($kp = mysql_fetch_array($result)) {
		//Return each page title seperated by a newline.
		echo "<option value='".$kp['Id']."'>".$kp['Name']."</option>";
	}
}

if (isset($_GET['kp']) && $_GET['kp'] != '') {
	//Add slashes to any quotes to avoid SQL problems.
	$kp = addslashes($_GET['kp']);
	//Get every page title for the site.
	//$result = mysql_query("SELECT * FROM kidqid,quiz");
	$result = mysql_query("SELECT * FROM kid_qid,quiz WHERE Q_Id=Id AND K_Id='".$kp."'");
	
	while($quiz = mysql_fetch_array($result)) {
		//Return each page title seperated by a newline.
		echo "<tr><td>".$quiz['Question']."</td><tr>";
	}
}
?>
Return current item: Decider