为什么会出现此错误? (解析错误:语法错误,第39行C:\ xampp \ htdocs \f.php中的文件意外结束) [英] Why is this error exist? (Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\f.php on line 39)

查看:128
本文介绍了为什么会出现此错误? (解析错误:语法错误,第39行C:\ xampp \ htdocs \f.php中的文件意外结束)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php
$conn = mysqli_connect('localhost','root','','khazar');
if(!$conn){
	die("Connection failed!!!").mysqli_error();
}
else{
	echo "Connected succesfully";
}

$sql = "SELECT * FROM students";
$result = mysqli_query($conn,$sql);
if(!$result){
	die("table connection problem!");
}
// listing all datas from table
echo "<h2>List of al records: ".mysqli_num_rows($result)."</h2>";
echo "<table>";
//if(mysqli_num_rows($result)>0){
	while ($row = mysqli_fetch_assoc($result)) {
		echo $row['id']." | ".$row['name']." | ".$row['username']." | ".$row['password']."<br>";
		?>

		<form method="post" action="$_SERVER['PHP_SELF']">
		<a href="f.php? id=<?php echo $row['id']?>">DELETE</a>
		<a href="f.php? id=<?php echo $row['id']?>">EDIT</a>
		<a href="f.php? id=<?php echo $row['id']?>">UPDATE</a>

<!--	}   -->
}
<?php
if(isset($_GET['id'])){
	$id = $_GET['id'];
	$sql2 = "DELETE FROM students WHERE id=".$id;
	mysqli_query($conn,$sql2);
	header("Location:".$_SERVER['PHP_SELF']);
}
mysqli_close($conn);
?>





我尝试过:



错误是:



解析错误:语法错误,C:\ xampp \ htdocs \\ .f中的文件意外结束。第39行的PHP



i改变了很多东西并尝试了,但这个错误总是存在。

请说,这个错误是什么意思?实际错误是什么?



What I have tried:

error is:

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\f.php on line 39

i changed many things and tried,but this error always exist.
please,say,what does this error mean? and what actually error is ?

推荐答案

conn = mysqli_connect('localhost','root','','khazar');
if(!
conn = mysqli_connect('localhost','root','','khazar'); if(!


conn){
die(Connection failed !!!)。mysqli_error();
}
else {
echo成功连接;
}
conn){ die("Connection failed!!!").mysqli_error(); } else{ echo "Connected succesfully"; }


sql =SELECT * FROM students;
sql = "SELECT * FROM students";


这篇关于为什么会出现此错误? (解析错误:语法错误,第39行C:\ xampp \ htdocs \f.php中的文件意外结束)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆