ok, now I want to insert a new student (which i do with a form on previos page and it works!!)
but i then want their first and last name and their student ID (thats just been auto-incremented when the record is added) to be displayed on the next page when thay have submitted their details. ( then they can create a password. )
But i cant display the names or student ID????
this is my code (i have altered it from the code given above)
<?php $mysql_database="enrolmentdb";
$link=mysql_connect("localhost",$mysql_host) or die(mysql_error());
mysql_select_db($mysql_database,$link) or dies(mysql_error());
$firstName_rsNewStudent = 'firstName';
if (isset($POST['firstName'])) //check if the var is set...
{ //it is...
$firstName = $POST['firstName']; //so set $firstName to it...
$firstName = (get_magic_quotes_gpc()) ? $firstName : addslashes($firstName);
}
$lastName_rsNewStudent = 'lastName';
if (isset($POST['lastName'])) //check if var is set...
{ //it is so.......
$lastName = $POST['lastName']; //set it to $lastName
$lastName_rsNewStudent = (get_magic_quotes_gpc()) ? $lastName : addslashes($lastName);
}
?>
<?php
mysql_select_db($database_connEnrolment, $connEnrolment);
$query_rsNewStudent = "SELECT * FROM students WHERE firstName='$firstName' AND lastName='$lastName'";
$rsNewStudent = mysql_query($query_rsNewStudent, $connEnrolment) or die(mysql_error());
$row_rsNewStudent = mysql_fetch_assoc($rsNewStudent);
$totalRows_rsNewStudent = mysql_num_rows($rsNewStudent);
?>
and to display them.....
<table width="100%" border="0">
<tr>
<td width="43%">Thank you, <?php echo $row_rsNewStudent['firstName']; ?> </td>
<td width="57%"><?php echo $row_rsNewStudent['lastName']; ?></td>
</tr>
<tr>
<td>Your Student ID is </td>
<td><?php echo $row_rsNewStudent['StudentID']; ?></td>
</tr>
</table>
<?php echo $row_rsNewStudent['StudentID'];
🙁
please help, i'm getting sooo confused 😕