Jump to content

Is this code correct? $sql =("SELECT * FROM student_details WHERE 'Parent_email'


dejai

Recommended Posts

please can someone check if this code is correct?

 

$sql =("SELECT * FROM student_details WHERE 'Parent_email'=". $_POST['usr']." && password=".$_POST['pw']);

 

No, it is not what was suggested here http://www.phpfreaks.com/forums/index.php/topic,269774.msg1272802.html#msg1272802

 

Try this pal.

 

Next time you pm anybody, please ask what you want, don't just post them code...

 

show everybody not just the helper wanting to help you.

 

<?php
$connect_mysql = mysql_connect($server, $servername, $password);

$db = "royaleng_solutionplus";

$mysql_db = mysql_select_db($db);


$Parent_email=mysql_real_escape_string($_POST['usr']);
$password=mysql_real_esape_string($_POST['pw']);

$sql_disp ="SELECT * FROM student_details WHERE Parent_email='$Parent_email'&& password='$password'";

$result = mysql_query($sql_disp) or die ("Select error".mysql_error());

if(mysql_num_rows($result)>0){

while($row = mysql_fetch_array($result)) {

echo"<tr ><DIV ALIGN=CENTER><h1>DETAILS OF REGISTRATION FORM</h1></DIV></tr>";
echo"<table border=1 color=brown ALIGN=CENTER> ";
   echo "<tr><h5><td><B>FIRST NAME</td><td><B>LAST NAME</td><td><B>SEX</td><td><B>Date of birth</td><td><B>Country</td><td><B>Origin</td><td><B>School</td><td><B>Class</td><p><p><p><p><p><p><td>Registration Status<B></td></tr>";
  echo"<tr>";
    echo"<td> {$row['First_Name']}</td>";
   echo"</tr>";
   echo"<tr>";
    echo"<td> {$row['Last_Name']}</td>";
   echo"</tr>";
   echo"<tr>";
    echo"<td> {$row['Sex']}</td>";
   echo"</tr>";
   echo"<tr>";
echo"<td> {$row['Date_Birth']}</td>";
echo"</tr>";
echo"<tr>";
echo"<td> {$row['Country']}</td>";
echo"</tr>";
echo"<tr>";
    echo"<td> {$row['Origin']}</td>";
   echo"</tr>";
   echo"<tr>";
echo"<td> {$row['School']}</td>";
echo"</tr>";
echo"<tr>";
echo"<td> {$row['Class']}</td>";
echo"</tr>";
echo"<tr>";
echo"<td> {$row['Reg_Status']}</td>";
  echo"</tr>";
   echo"</table>";
   echo"</table>";
}

}else{

echo "Sorry we have no info on this user.";

exit;
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.