I'm trying to call a row update from php to an mysql database. It fails out but when i try to call an insert new row formated just the same it works.
$result = mysql_query("INSERT INTO auth (username, password, studycode, description, server) VALUES ('$username', '$password', '$studycode', '$description', '$server')");
but this code fails
$result = mysql_query("UPDATE auth SET username='$username', password='$password', studycode='$studycode', description='$description', server='$server' WHERE index='$id' LIMIT 1;");
index is the first column and its the key/id for the table.
Edit: Ok so i just went into mysql admin and tried the exact command my code would have sent to track the error.
UPDATE auth SET username='username', password='password', studycode='ab9102y', description='test change', server='server2' WHERE index='5' LIMIT 1;
gives me the error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index='5' LIMIT 1' at line 1