ShootingBlanks Posted June 25, 2007 Share Posted June 25, 2007 Hello, all. I checked around and couldn't find an answer to this, so I'm posting... ...I am VERY VERY new to PHP and MySQL. I used phpMyAdmin to create a new database called "highscore". In it is one table called "topten" with two columns, as you can see in the screencap below my message (to see how I set them up)... ...I go to my MySQL Command Line Client and type in the following to get the error in bold below: mysql> use highscore Database changed mysql> INSERT topten (name,score) VALUES (matt,12); ERROR 1054 (42S22): Unknown column 'matt' in 'field list' What am I doing wrong here? I just want to enter "matt" in the "name" column, and "12" in the "score" column of the "topten" table. I assume it's something having to do with how I initially set up the table, but I'm not sure. Any help would be greatly appreciated. Thanks!!!... Quote Link to comment https://forums.phpfreaks.com/topic/57109-solved-newbie-here-basic-phpmysql-error/ Share on other sites More sharing options...
.Stealth Posted June 25, 2007 Share Posted June 25, 2007 try this: INSERT INTO topten SET name = 'matt', scroe = '12'; Just see if that works, your table looks fine to me and the error suggests that its interpreting one of your values as a table. EDIT: your missing the INTO in the below i think: mysql> INSERT topten (name,score) VALUES (matt,12); should be mysql> INSERT INTO topten (name,score) VALUES (matt,12); Quote Link to comment https://forums.phpfreaks.com/topic/57109-solved-newbie-here-basic-phpmysql-error/#findComment-282170 Share on other sites More sharing options...
ShootingBlanks Posted June 25, 2007 Author Share Posted June 25, 2007 I just realized that (being a stupid newbie! ) I forgot to put quotes around "matt". Thanks, though!!! Quote Link to comment https://forums.phpfreaks.com/topic/57109-solved-newbie-here-basic-phpmysql-error/#findComment-282173 Share on other sites More sharing options...
.Stealth Posted June 25, 2007 Share Posted June 25, 2007 ive edited the above post. you are missing the INTO part of your query. Quote Link to comment https://forums.phpfreaks.com/topic/57109-solved-newbie-here-basic-phpmysql-error/#findComment-282175 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.