问题描述
我正在学习PHP和MySQL。在我使用的示例中,SQL表
名称是转义的。重音符号(`)标记,而不是单个或双重
报价。
任何人都可以解释一下吗?
例如,我有以下内容:
$ sql_command =" SELECT * from`7-1_List`" ;;
我尝试在php.net网站上四处寻找,但显然我没有使用
正确的搜索条件。
我在问,我想我已经弄清楚双引号(")
与单引号('')有什么不同,但是如果有讨论那么
有人可以请指出,那将是非常好的。
谢谢。
那是因为它是MySQL惯例而与PHP无关。
试试MySQL文档。 />
SQL命令只是PHP传递给数据库的字符串。从那里开始,这是数据库的责任。
-
======== ==========
删除x来自我的电子邮件地址
Jerry Stuckle
JDS计算机培训公司
==================
I''m learning PHP and MySQL. In the samples I work with, the SQL table
names are "escaped" in accent grave (`) marks, not in single or double
quotes.
Can anyone explain that?
For instance, I have the following:
$sql_command = "SELECT * from `7-1_List`";
I tried looking around on the php.net site, but clearly I''m not using
the right search terms.
While I''m asking, I think I''ve figured out how double quotes (")
differ from single quotes (''), but if there is a discussion that
someone can point me to, that would be very nice.
Thanks.
That''s because it''s a MySQL convention and has nothing to do with PHP.
Try the MySQL documentation.
SQL commands are just strings PHP passes to the database. From there
on, it''s the databases responsibility.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
这篇关于PHP代码中的MySQL表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!