For the life of me I cannot figure out this error.
require_once 'mysql.php'; // connect to MYSQL
-> $query = "INSERT INTO table (name, age, email, mc, sm, fit, trax, hh, claimed, handled, status)
VALUES ('".$name."', '".$age."', '".$email."', '".$mc."', '".$sm."', '".$fit."', '".$trax."', '".$howheard."', '".$claimed."', '".$handled."', '".$status."')"; mysql_query($query) or die ('databse couldnt be updated'); echo "<br/><br/>Database updated with the information for MCID " .$mc. "<br/><br/>";
error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\NAMEME.php on line 80 (Where the "->" is.)
Now, all this code was working fine, until I made a change to the mysql table I am using. I added a column named "id" and made it auto-increment. Here is the table structure:
CREATE TABLE whitelist (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
age INT NOT NULL,
email TEXT NOT NULL,
minecraft TEXT NOT NULL,
steam TEXT NOT NULL,
fit INT NOT NULL,
trax TEXT NOT NULL,
howheard TEXT NOT NULL,
claimed INT NOT NULL,
handled INT NOT NULL,
status INT NOT NULL,
PRIMARY KEY (id) ) ENGINE=MyISAMpablocdb
I truly cannot figure out where there is text that it wants to be a , or ;. Any help is appreciated.
Thanks!
UPDATE: Silly me, thanks to the guy who suggested I look up higher. My error was that I forgot to complete an echo function. I had:
echo "Hello
a few lines above. Silly me. Thanks for the quick responses, everyone :)
80
-- that is just where the interpreter gave up. Look a few lines higher.