Home  >  Article  >  Backend Development  >  How to use PHP's own function library DEBUG? (code example)

How to use PHP's own function library DEBUG? (code example)

不言
不言forward
2019-02-18 14:15:541835browse

本篇文章给大家带来的内容是关于PHP自带函数库DEBUG如何使用?(代码示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

在建立数据库时,不知道为什么用以下代码建立不出来,也不知道为什么,其中conn.php是连接Mysql数据库的文件

include ("conn.php");
$sql1 = "CREATE DATABASE zhygl";
$result1 = mysqli_query($conn, $sql1);
//创建zhygl数据库;
mysqli_select_db($conn, "zhygl");
$sql2 = "CREATE	TABLE user_info(
id int AUTO_INCREMENT NOT NULL,
user_id varchar(50),
nick_name varchar(30),
gender tinyint(1),
city varchar(30),
	province varchar(30),
	country varchar(30),
	if_approve tinyint(1),
	ticket_num int,
	place_num int
	)";

然后我再利用mysqli_erro()函数查错,

if ($result2) {
		echo "success!";
	}else {
		trigger_error(mysqli_error($conn),E_USER_ERROR);
}

注意,mysqli_erro()函数接受一个参数就是你链接的那个数据库

Fatal error: Incorrect table definition; there can be only one auto column and it must be defined as a key in D:\WAMP\Web1\123.php on line 26

最后在HTML文件显示出以上错误,debug结束,修改相关语法即可

The above is the detailed content of How to use PHP's own function library DEBUG? (code example). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete