** [MySQL]: Unknown column 'Gold' in 'field list'
#1

I dont understand this error, can you help me?

pawn Code:
format(query, sizeof(query), "UPDATE `characters` SET `Created` = '%d', `Gender` = '%d', `Birthdate` = '%s', `Origin` = '%s', `Skin` = '%d', `PosX` = '%.4f', `PosY` = '%.4f', `PosZ` = '%.4f', `PosA` = '%.4f', `Health` = '%.4f', `Interior` = '%d', `World` = '%d', `Hospital` = '%d', `HospitalInt` = '%d', `Money` = '%d', `Gold` = '%d', `BankMoney` = '%d', `OwnsBillboard` = '%d', `Savings` = '%d', `Admin` = '%d', `Helper` = '%d', `Moderator` = '%d', `JailTime` = '%d', `Muted` = '%d'",
Reply
#2

Well, it's pretty self explanatory. The 'Gold' field (column) is not recognized by your 'characters' table, so make sure that field exists.
Reply
#3

Okay, How can i create an new column for the gold?
Reply
#4

The string you are formatting there is a query. Where do queries go? To a SQL database. What is a SQL database made of? Tables. What are the main elements of a table? Fields. Are fields in the script? No, they are in a table. Are you sure that the field "Gold" really exists in your table? We don't know, but we hope to find out.
Reply
#5

Using phpmyadmin, you can simply go to the table and in the structure panel page click "add a column to the table".

Additionally, you can use a SQL query to modify the data:
pawn Code:
ALTER TABLE `characters` ADD `Gold` INT NOT NULL ;
Reply
#6

Quote:
Originally Posted by HazardouS
View Post
The string you are formatting there is a query. Where do queries go? To a SQL database. What is a SQL database made of? Tables. What are the main elements of a table? Fields. Are fields in the script? No, they are in a table. Are you sure that the field "Gold" really exists in your table? We don't know, but we hope to find out.
I found out that there is no column from Gold in the SQL, how can i create an new column
Reply
#7

Do what Abagail said above. Choose the method that's simpler for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)