PHP代码中存在语法错误 [英] Syntax error is there in PHP code

查看:55
本文介绍了PHP代码中存在语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php
$server="localhost";
$username="root";
$password="";
$database="userslogin";
$conn=mysqli_connect($server,$username,$password,$database) or die("The connection to the database is invalid");
?>
<?php

$query="SELECT * FROM users";

$result=mysqli_query($conn,$query);

$rows=mysqli_num_rows($result);



?>
<!DOCTYPE html>


<title>Test of selecting data in php


	<div id="table">
		
		<?php while($rows=mysqli_fetch_array($rows,MYSQLI_ASSOC))
		{
			$name=$rows['UserName'];
			$email=$rows['Email'];
			
			
			?>
			
				
				
				
			
				
				
			
			
	
		<table><tbody><tr><th>Name</th><th>Email</th></tr><tr><td><?php echo $name;?></td><td><?php echo $email;?></td></tr></tbody></table>
		<?php}?>
	</div>





我的尝试:



解析错误:语法错误,第48行的C:\ xampp \ htdocs \CMS \ test.php中的意外文件结束





此代码运行错误



What I have tried:

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\CMS\test.php on line 48


what is wrong with this code it is not running

推荐答案

ser ver = localhost;
server="localhost";


username = root;
username="root";


password = ;
password="";


这篇关于PHP代码中存在语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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