Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.