Home  >  Article  >  Backend Development  >  mysql DROP DATABASE有关问题

mysql DROP DATABASE有关问题

WBOY
WBOYOriginal
2016-06-13 13:26:46905browse

mysql DROP DATABASE问题
新手问题。
mysql_query("DROP DATABASE 123");
这样不能删除数据库(其他的可以删除,像123这个就不可以).


mysql_query("DROP DATABASE `123` ");
这样就没问题了!
为什么会这样? ` ` 这个起到了什么作用呢?新手问题!

------解决方案--------------------
转义的作用。事实上库名以数字开头是不规范的。
------解决方案--------------------
在mysql的执行语句中,所有的特殊字段,如:date、sum……,必须用 ` 引起来才能有效执行
------解决方案--------------------

探讨

转义的作用。事实上库名以数字开头是不规范的。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article: PHP 兑现爱查快递接口 Next article: php剔除记录