MySQL Update

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Bert
Forum Newbie
Posts: 6
Joined: Sat Dec 07, 2002 12:26 pm
Location: California, USA

MySQL Update

Post 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>
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post 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");
Post Reply