Im trying to implement a simple script that will enable me to modify an existing entry (being the student firstname) within my database based on the user_id field
When i execute within my browser i get:-
Parse error: parse error in c:\program files\apache group\apache\htdocs\sis\edit_student_entry.php on line 5
Can anybody help, i think there is an issue with my syntax, i can get this mysql query to excute within MS DOS command line but not through my PHP script.
<h2>Edit A Student</h2>
<form method=post action="edit_student_entry.php">
<b>Student ID:</b>
<input type=text size=5 name=student_id>
<br>
<b>First Name:</b>
<input type=text size=20 name=first_name>
<br>
<b>Last Name:</b>
<input type=text size=15 name=last_name>
<br>
<b>Module ID:</b>
<input type=text size=4 name=module_id>
<br>
<input type=submit name=submit value="Submit">
<input type=reset name=reset value="Clear">
This is the edit_student_entry script.
<?php include("dbconnect.php"); ?>
<?php
$query = "update student_table set first_name="$first_name" where student_id="$student_id" "
;
mysql_query($query);
?>
<h2>Edit Succesful</h2>
<h2><a href="index.html">Click to go back</a></h2>
To further myself after troubleshooting this, any tips on a query statement that will allow me to edit ANY field based on the 'student_id' entry?
All Help much appreciated.