让die()生活在生产环境中被认为是不好的做法吗?刚刚读过这篇文章http://www.phpfreaks.com/blog/or-die-must-die,作者对在生产环境中使用这类东西的人进行了抨击.所以我不应该这样编码:
$connection = mysql_connect($db_host, $db_username, $db_password);
if (!$connection){
die ("Could not connect to the database.");
}
Run Code Online (Sandbox Code Playgroud)
你怎么编码?
如果这很重要,我也将其设置为唯一
我设法为 varchar 设置的最大值是745(它也设置为唯一的)。
我想存储的纬度39.8162994和经度-98.5576019为花车,但原来是这样0.00000000000,并-98.55760192871相应地.
有什么问题?我float(15,11)用作数据类型.
当无法访问Web上的某些内容(api,数据库)时,如何停止执行脚本的其余部分并将错误记录在日志文件中?嗯,所以访问者不会看到确切的原因,而是他们会看到我的自定义消息(例如,'一件坏事刚刚发生').我需要采取哪些步骤来安排事情?
我在验证器中收到此错误:
Line 47, Column 187: character "&" is the first character of a delimiter but occurred as data
…num, silver diamonds. cartier tiffany & Co. $18 WALKING LIBERTY DOLLARS $15…
This message may appear in several cases:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is …Run Code Online (Sandbox Code Playgroud)