what does it mean to have a dot after table name when using insert into in mysql?

Tongtong Zhang :

I see this statement in the code INSERT INTO question.surveykey (dateposted,entryCount) VALUES ('$date',0),

Shouldn't it be a table name after insert into statement? What does it mean to have a dot after that?

Ja͢ck :

You can find plenty of examples in the manual regarding identifier qualifiers.

You can refer to a table within the default database as tbl_name, or as db_name.tbl_name to specify a database explicitly.

Without the explicit mention of a database name, the default database is used (when you're on the console, you'd set the default database by entering use db_name).

This comes in handy when you've got a seed file that populates tables across multiple databases, or if you're in one database (using console) and you want to operate on a table in another.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=337016&siteId=1