mysql DROP DATABASE有关问题

WBOY
Release: 2016-06-13 13:26:46
Original
905 people have browsed it

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


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

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

探讨

转义的作用。事实上库名以数字开头是不规范的。
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!