php error. Parse error: syntax error

Parse error: syntax error, unexpected '$query' (T_VARIABLE) in C:xampphtdocsconnection.php on line 15

Error i am a begginer kinda on website making but pro on visual studio programming please tell me whats wrong here. The code:

http://pastebin.com/bE1dXARC

Learning coding from youtube. If this is suspicious. Link:https://www.youtube.com/watch?v=w428f-ByczE&src_vid=YkzD5lYUsEs&feature=iv&annotation_id=annotation_169240 please help.


Semicolon is missing in the lines where you are echoing the queries. You have to end PHP line of code with a semicolon.

@mysql_select_db($website_information) or ("Database error number 1");

echo $query;
echo $querypass;
echo $queryemail;

第13行没有分号

@mysql_select_db($website_information) or ("Database error number 1") and

echo $query
echo $querypass
echo $queryemail 

as mentioned by @Jenz

There was no die() after @mysql_select_db, added that. No semicolons after line 13, 19, 20, 21, added them too.

<?php
$inputuser = $_POST["usernamelogin"];
$inputpass = $_POST["passlogin"];
$inputemail = $_POST["emaillogin"];
$usernamelogin = "";
$passlogin = "";
$emaillogin = "";
$connect = mysql_connect("localhost",$usernamelogin,$passlogin,$emaillogin);
@mysql_select_db($website_information) or die("Database error number 1");
$query = "SELECT * FROM `critical_account_information` WHERE `usernamelogin` = '$inputuser'";
$querypass = "SELECT * FROM `critical_account_information` WHERE `passlogin` = '$inputpass'";
$queryemail = "SELECT * FROM `critical_account_information` WHERE `emaillogin` = '$inputemail'";

echo $query;
echo $querypass;
echo $queryemail;

mysql_close();
?>
链接地址: http://www.djcxy.com/p/69590.html

上一篇: mysql数据存在代码无法正常工作

下一篇: PHP错误。 解析错误:语法错误