Jump to content

[SOLVED] parse error


wtfsmd

Recommended Posts

Hey i have the following error, and i have searched over the code in the area and nothing caught my eye.

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/t/i/m/timeba/html/newsite/login1.php on line 42

Here is the code from line 35 - 45
[code]
$check = $db_object->query("SELECT username, password FROM users WHERE username = '".$_POST['uname']."'");

$sql = "SELECT username, password FROM users WHERE username = '".$_POST['uname']."';

$result = mysql_query($sql) or die(mysql_error());

while($row = mysql_fetch_array($result)) {
$_SESSION['rank'] = $row['userrank'];
}


if (DB::isError($check) || $check->numRows() == 0) {
[/code]

Thanks, wtfsmd
Link to comment
https://forums.phpfreaks.com/topic/33186-solved-parse-error/
Share on other sites

Just to help you out with quotes and the such, you could phrase variables in 2 other ways...

Without single quotes. Example:
$sql = "SELECT username, password FROM users WHERE username = '$_POST[uname]'";

With huggie brackets. Example:
$sql = "SELECT username, password FROM users WHERE username = '{$_POST['uname']}'";
Link to comment
https://forums.phpfreaks.com/topic/33186-solved-parse-error/#findComment-154883
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.