语法错误,意外的 T_VARIABLE [英] syntax error, unexpected T_VARIABLE

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

问题描述

我似乎无法找到我的代码出错的地方.这是我的完整错误:

I can't seem to find where my code has went wrong. Here is my full error:

解析错误:语法错误,C:\xampp\htdocs\GigaLoad.com\register.php 中第 102 行出现意外的 T_VARIABLE

Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\GigaLoad.com\register.php on line 102

但我一直在寻找那条线路几个小时.我会给你完整的代码,因为我的新手大脑找不到错误:

But I've been looking a that line for hours. I will give you the entire code cause my newbie brain cant find the error:

$query = mysql_query("SELECT * FROM users WHERE username='$username'")

希望您能提供帮助,如果您需要更多信息,请告诉我.

Hope you can help if you need more info just let me know.

这是额外的代码

 if (strstr($email, "@") && strstr($email, ".") && (strlen($email) >=6)){
   require ("scripts/connect.php")
   $query = mysql_query("SELECT * FROM users WHERE username='$username'") // <-- Error here
   $numrows = mysql_num_rows ($query)
   if ($numrows == 0){
        /* ... */

我仍然遇到重大错误,我将提供代码,你能告诉我我遗漏了什么

I am still getting major erros i will give the code and can you tell what i am missing

推荐答案

该指令末尾没有分号导致错误.

There is no semicolon at the end of that instruction causing the error.

编辑

就像 RiverC 指出的那样,上一行的末尾没有分号!

Like RiverC pointed out, there is no semicolon at the end of the previous line!

require ("scripts/connect.php") 

编辑

您似乎没有任何分号.

http://php.net/manual/en/language.basic-syntax.instruction-separation.php

与在 C 或 Perl 中一样,PHP 要求在每条语句的末尾以分号终止指令.

As in C or Perl, PHP requires instructions to be terminated with a semicolon at the end of each statement.

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

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