Home >Backend Development >PHP Tutorial >php 在执行mysql 失败后 如何写异常提示

php 在执行mysql 失败后 如何写异常提示

WBOY
WBOYOriginal
2016-06-13 11:54:011177browse

php 在执行mysql 失败后 怎么写错误提示
在写php时 有时因为输入的字段超出 在mysql 设的字段长度 虽然 语句执行正常 但在数据库中没有成功加入 求提示写法
------解决方案--------------------
mysql_query($sql) die(mysql_error());

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