Parse error: parse error, unexpected $end,怎么解决?

anyue 2006-08-27 12:06:38
<?php

$connect = mysql_pconnect("localhost","root","");
mysql_select_db("UserInfo",$connect);

if($UserName)
{
$query="insert into UserInfo values(null,'"."'".$username."','".$password;
$query=$query."','".$name."')';

$result=mysql_query($query);
mysql_free_result($result);
}
mysql_close($connect);

?>
...全文
309 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
swazn_yj 2007-04-26
  • 打赏
  • 举报
回复
PHP Parse Error: syntax error, unexpected $end 解决方法2007-02-09 11:12In PHP 5, the following error may appears as an error entry in Apache error log or simply displays on PHP web page, even if calling to php scripts with php_info() works perfectly and successfully returns information on PHP configurations:

Parse Error: syntax error, unexpected $end in ….. scripts.php on line …

The error may caused by a missing curly bracket in PHP script coding. Beside, it may also caused by error in PHP coding in class definition, as in PHP, a class definition cannot be broke up and distributed into multiple files, or into multiple PHP blocks, unless the break is within a method declaration.

But more commonly, the error is often caused by the use of Short Open tags in PHP,

To use short open tags, it must be enabled in PHP.INI. Search for short_open_tag in PHP.INI, and change the value to On. The line should look line:

short_open_tag = On
caotian2000 2006-08-27
  • 打赏
  • 举报
回复
$query="insert into UserInfo values(null,'"."'".$username."','".$password;
$query=$query."','".$name."')';

这个语句有点问题
wasuka 2006-08-27
  • 打赏
  • 举报
回复
$query="insert into UserInfo values(null,'"."'".$username."','".$password;

这句忒乱了...

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧