dejai Posted September 21, 2009 Share Posted September 21, 2009 please can someone check if this code is correct? $sql =("SELECT * FROM student_details WHERE 'Parent_email'=". $_POST['usr']." && password=".$_POST['pw']); Link to comment https://forums.phpfreaks.com/topic/174989-is-this-code-correct-sql-select-from-student_details-where-parent_email/ Share on other sites More sharing options...
smerny Posted September 21, 2009 Share Posted September 21, 2009 WHERE Parent_email = '".$_POST['usr']."' AND password='".$_POST['pw']."' Link to comment https://forums.phpfreaks.com/topic/174989-is-this-code-correct-sql-select-from-student_details-where-parent_email/#findComment-922245 Share on other sites More sharing options...
smerny Posted September 21, 2009 Share Posted September 21, 2009 $sql ="SELECT * FROM student_details WHERE Parent_email = '".$_POST['usr']."' AND password='".$_POST['pw']."'; $action = mysql_query($sql) or die("SQL Error: ".mysql_error()); Link to comment https://forums.phpfreaks.com/topic/174989-is-this-code-correct-sql-select-from-student_details-where-parent_email/#findComment-922258 Share on other sites More sharing options...
ozestretch Posted September 21, 2009 Share Posted September 21, 2009 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 Link to comment https://forums.phpfreaks.com/topic/174989-is-this-code-correct-sql-select-from-student_details-where-parent_email/#findComment-922275 Share on other sites More sharing options...
shane18 Posted September 21, 2009 Share Posted September 21, 2009 $sql="SELECT * FROM student_details WHERE Parent_email='{$_POST["usr"]}' && password='{$_POST["pw"]}'"; Link to comment https://forums.phpfreaks.com/topic/174989-is-this-code-correct-sql-select-from-student_details-where-parent_email/#findComment-922413 Share on other sites More sharing options...
redarrow Posted September 23, 2009 Share Posted September 23, 2009 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; } ?> Link to comment https://forums.phpfreaks.com/topic/174989-is-this-code-correct-sql-select-from-student_details-where-parent_email/#findComment-923228 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.