Home >Backend Development >PHP Tutorial >php怎的显示mysql的warning信息

php怎的显示mysql的warning信息

WBOY
WBOYOriginal
2016-06-13 12:04:411004browse

php怎样显示mysql的warning信息?
php怎样显示mysql的warning信息?

例如:   table里有一个type是date的数据.
如果我在phpmyadmin里输入string之类的,会显示warning信息.

但我用php更新数据的话,会把这个数据变成0000-00-00.
怎样用php更新数据后,如果数据格式不对,显示这个warning信息呢?

thx
------解决方案--------------------
mysql_error()  
试试这个?
------解决方案--------------------
mysql_query("SHOW WARNINGS");
可以取到warning信息

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