The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
$query = "SELECT customerPass FROM customers WHERE customerUsername = $_POST['username']";
Leads so jovially onto this :
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /the/file/is_here/darktest.php on line 24
Thoughts? It works fine when I just use '$username'.
p/h
> Beaten to it by Garin. :-)
Lol, ditto, but ideally you should have single quotes (') around a value on a WHERE expression in MySQL. Along with the correct string escaping etc, it stops people "modifying" your MySQL query.
> $query = "SELECT customerPass FROM customers WHERE
> customerUsername = $_POST['username']";
Try instead:
$query = "SELECT customerPass FROM customers WHERE customerUsername = '".$_POST['username']."';";
or better
$query = "SELECT customerPass FROM customers WHERE customerUsername=".$_POST['username'];
Although you shouldn't throw GET/POST data into queries like that in the first place without validating it in some way.
$query = "SELECT customerPass FROM customers WHERE customerUsername = $_POST['username']";
Leads so jovially onto this :
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /the/file/is_here/darktest.php on line 24
Thoughts? It works fine when I just use '$username'.
p/h