I'm writing a PHP script to basically update a value in a table. Currently, the value is NULL
, and is TEXT
. When I try to set it to a string using PHP, I get this error:
Unknown column '' in 'field list'
I have no idea what this means, and all of the other StackOverflow solutions for this have not helped.
SQL:
UPDATE
`teacher_accounts`
SET
`quizzes` = "QUIZ_STRING"
WHERE
`id` = "TEACHER_ID";
Table structure:
`id` INT(11),
`email` TEXT,
`full_name` TEXT,
`password` TEXT,
`permissions` TEXT,
`activated` TEXT,
`quizzes` TEXT
All are filled in except for quizzes which is currently NULL
. I've been banging my head on the keyboard for this... I'm sure this is an easy fix, sorry if it is a dumb mistake. Thanks in advance!
Mistri
Have you tried to run the query directly on mysql ?
In your PHP file try this instead
UPDATE
teacher_accounts
SET
quizzes = "QUIZ_STRING"
WHERE
id = "TEACHER_ID";
Column names don't have single quotes in SQL inside PHP