RE: Returns Blank

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, any text elements need single quotes around it for the sql engine to evaluate it properly


s/b

$query = "SELECT credits FROM krypto WHERE user='$user' AND pass='$pass'";

to give you

query = SELECT credits FROM krypto WHERE user='admin' AND pass='xxxxxxxx'


bastien


From: Squeakypants <squeakypants@xxxxxxxxx>
Reply-To: Squeakypants <squeakypants@xxxxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject:  Returns Blank
Date: Thu, 20 Jan 2005 16:37:09 -0500

From a forum that recommended this to me, I changed the query execution to this:
$query = "SELECT credits FROM krypto WHERE user=$user AND pass=$pass";
echo "query = ". $query ."\n";
$result = mysql_query($query);
echo "result = ". $result ."\n";


So now it outputs this:
query = SELECT credits FROM krypto WHERE user=admin AND pass=xxxxxxxx
result = Could not run query: Unknown column 'admin' in 'where clause'


-- 'You are currently using 15 MB (0%) of your 1000 MB.' Isn't Gmail swell? Isn't life swell?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux