user3806126 user3806126 - 6 months ago 5
MySQL Question

MySQL select table

How can I select a MySQL table when the table name is in the URL format?

SELECT hash FROM 'http://www.mittelbayerische.de' WHERE time = '1465132682'


This will output following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''http://www.mittelbayerische.de' WHERE time = '1465132682'' at line 1

Xen Xen
Answer

Are you sure that's a table name?

Anyway assuming it is, you should be able to use backticks to quote the table name.

SELECT hash FROM `http://www.mittelbayerische.de` WHERE time = '1465132682'