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

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

不言
Release: 2023-04-05 10:06:01
forward
2028 people have browsed it

本篇文章给大家带来的内容是关于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
	)";
Copy after login

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

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

注意,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
Copy after login

最后在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!

Related labels:
php
source:csdn.net
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template