This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

Syntax request for using email id as table name

I am using $_SESSION['email'] as a table name for create table query. I am receiving error :You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@gmail.com How to use email id as table name?

Answer Answered by Daniel Black in this comment.

You can, with the right quoting like:

create table `badtablename@gmail.com` (i int)

This is a bad pattern however. Data should be in rows, not table names.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.