Topic: Help with MYSQL and getting records by id
Hello, I was wondering if anyone can help me out..... I am trying to get records from mySQL database by id.....but I don't know what I am doing wrong and why it is not working.....can anyone help me? please?
here is the code.....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>members area</title>
</head>
<?php
//===============================================
//CONNECT TO MY DATABASE AND SELECT MY DATABASE
$con = mysql_connect('localhost','root','');
$sel = mysql_select_db('calendar');
//===============================================
//DEFINE VARIABLES FOR MYSQL ROWS
$id = $_GET['ff_id'];
//BUILD MY QUERY
$Q = "SELECT * FROM ps69_school_registration WHERE ff_id = '$id'";
$res = mysql_query($Q);
$my_rows;
//NOW I WILL CREATE A LOOP COMMAND
while($row = mysql_fetch_array($res,MYSQL_ASSOC)){
$my_rows = $my_rows . "id: " . $row['ff_id'] . " Student Name: " . $row['Student_full_name'];
}
?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="get">
student id: <input type="text" name="id"/><input type="submit" value="get record"/>
</form>
<body>
<?php echo $my_rows; ?>
</body>
</html>

