the form part where the user input is taken
<form action="result.php" method="post">
<input type="text"name="input"size=40>
<input type="submit"value="SUBMIT">
and the result part
Code: Select all
<?php
$dbuser = 'root';
$dbpass = '';
$db='owaiskhan';
$dbhost='localhost';
$conn = mysqli_connect($dbhost,$dbuser,$dbpass,$db);
if(! $conn )
{
die('Could not connect: ' . error);
}
$input = mysqli_real_escape_string($conn, $_POST['input']);
$result="SELECT answers_1.*, answers_2.*, answers_3.*, answers_4.*, biodata.* FROM answers_1 INNER JOIN answers_2 ON
answers_1.anseng_id = answers_2.anseng_id AND answers_1.anseng_id INNER JOIN biodata ON biodata.anseng_id = answers_1.anseng_id INNER JOIN
answers_3 ON biodata.anseng_id = answers_3.anseng_id INNER JOIN answers_4 ON biodata.anseng_id=answers_4.anseng_id WHERE biodata.anseng_id='".$input."' " ;
//echo "$query";
echo"$result";
?>