Page 1 of 1

MySQL Update

Posted: Tue Dec 24, 2002 4:28 pm
by Bert
When I run this script it says that there's an error on line 12. What's wrong with the code?

Code: Select all

<?
$student = $_POST['student'];
$level = $_POST['level'];

mysql_connect("localhost","rskingd","*****") or die ("Cannot Connect to DB");
mysql_select_db("rskingd_uk_db") or die ("Cannot Select DB");

$query="update rsd_students
  set level = '$level'
  where name = '$student'";

mysql_query=("$query") or die ("Cannot Query DB");
?>

<html>
<head>
    <title>Level Entered</title>
</head>
<body>
print("
If no errors occured then $student's level was changed to $level. If errors did occur please contact Bert204. Click <a href=http://avidgamers.com/members.php>here</a> to go back.
");


</body>
</html>

Posted: Tue Dec 24, 2002 4:39 pm
by mydimension
first off, it helps if you tell us what the error is and it also helps if you give us more than a line number so we don't have to go trudging throught the code.

that said, you have a misplaced = on this line: mysql_query=("$query") or die ("Cannot Query DB");