Jump to content

Simple Insert Into MySQL Query


JayIsAStar

Recommended Posts

I am trying to insert some information into a MySQL database

I hope someone can help tell me what I did wrong

 

My Code: http://pastie.org/8213129 - Before you ask $userid; is already defined on another page before this is included and i know that is not the issue.

 

Error:

Unknown column 'cgvdfbfx' in 'field list'

cgvdfbfx is the value of $posted222;

 

Thanks in advance,

Link to comment
https://forums.phpfreaks.com/topic/280908-simple-insert-into-mysql-query/
Share on other sites

string data values must be enclosed by single-quotes inside the query statement so that they are treated as literal string data values, otherwise they are treated as identifiers (database, table, or column names - which is what is occurring in your case) or treated as mysql keywords, functions, or operators.

 

programming requires that you know the meaning of everything in the code in front of you. to successfully write a sql query statement, you must know the syntax for the type of query you are writing, what the keywords, functions, and operators mean and where they go in the query, where the identifiers (database, table, or column names) go, where the data values go, and how to treat each different type of data.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.