
正文
php数据库提示 php显示数据库
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
PHP连接数据库后总是提示格式错误要怎么解决?求指点~
查看PHP7.1官方文档,对这种错误的解释
New E_WARNING and E_NOTICE errors have been introduced when invalid strings are coerced using operators expecting numbers (+ - * / ** % | ^) or their assignment equivalents. An E_NOTICE is emitted when the string begins with a numeric value but contains trailing non-numeric characters, and an E_WARNING is emitted when the string does not contain a numeric value.
在使用(+ - * / ** % | ^) 运算时,例如a+b,如果a是开始一个数字值,但包含非数字字符(123a),b不是数字值开始时(b456),就会有A non-numeric value encountered警告。
你的里面年月日的表达用了-,php认为是减号,年月日被认为是运算。
你可以搜一下网上的教程有解决办法。不过看你的截图,这只是个notice, 你可以在控制器加上ini_set("error_reporting","E_ALL ~E_NOTICE"); 就不会显示了。
相关问答
Q1: php连接独享型数据库提示错误
检查你的数据库是否支持远程连接;检查你的数据库地址是否错误;
有些提供商的端口并不是3306;可能其它的;请检查后再试试
Q2: php连接数据库 提示:no database selected
两种可能php数据库提示,要么没连上php数据库提示,要么不存在hij数据库
if(!mysql_select_db($this-db_database,$this-conn))上面添加一行来判断是否连上
if (!$this-conn)
{
die('Could not connect: ' . mysql_error());
}
关于php数据库提示和php显示数据库的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。







