Jump to content

Problem with Syntax?


Styles2304

Recommended Posts

Here's the code I ran to setup my DB table: BonusInfo

 

CREATE TABLE `black_arku`.`BonusInfo` (`IndexNo` SMALLINT NOT NULL ,`Bonus` TEXT NOT NULL ,`History` TEXT NOT NULL ,INDEX ( `IndexNo` ));

 

And then here is the insert statement I'm trying to execute but I'm getting a syntax error:

 

INSERT INTO `black_arku` . `BonusInfo` VALUES (1, '0', '0');

 

Is there something I'm missing?

Link to comment
https://forums.phpfreaks.com/topic/149538-problem-with-syntax/
Share on other sites

OK

INSERT INTO Bonusinfo (IndexNo, Bonus, History) VALUES ('1','0','0');

 

This is the way  your query should look.

 

INSERT INTO Tablename (Fieldname, Fieldname, Fieldname) VALUES ('value','Value','Value');

 

Connection to the database should be made earlier.

 

 

 

 

 

 

It is perfectly valid, acceptable and even semi-common to not select a database.

 

 

The full name of a table can be used in a statement.

 

 

INSERT INTO database.table.....

Link to comment
https://forums.phpfreaks.com/topic/149538-problem-with-syntax/#findComment-785458
Share on other sites

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.