Can you DROP TABLE IF EXISTS by specifying database name with table?

三世轮回 提交于 2019-12-04 03:22:37
mysql_query('DROP TABLE IF EXISTS `dbName`.`tableName`') or die(mysql_error());

You should use backticks instead of double quotes like this:

mysql_query('DROP TABLE IF EXISTS `dbName`.`tableName`');

You can't use double quotes to quote db/table names, instead you either leave them unquoted or use backticks. But to answer your question, yes it is perfectly valid to specify the database name.

DROP TABLE `dbName`.`tableName`
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!