Re: Returns Blank
| From: | Martin Norland | Date: | Thu, 20 Jan 2005 14:27:53 +0000 |
| Subject: | Re: Returns Blank | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38228@lists.php.net to get a copy of this message | ||
Squeakypants wrote:
I can't figure this out, it just shows blank... $user=$_POST['user']; $pass=$_POST['pass']; mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database");You're suppressing the error returned from mysql_select_db with the @ symbol. Remove it and you'll get something useful - but you'd do better to put the die on the mysql_connect and return mysql's error message.
$query = "SELECT credits FROM krypto WHERE user = '" . $user . "' AND pass = '" . $pass . "'";Just as a point of information, you don't need to break out of your quoting to add the variables here: $query = "SELECT credits FROM krypto WHERE user = '$user' AND pass = '$pass'"; will work fine. Variables embedded in double quotes are expanded - though with arrays you will need to enclose them in {$curlies['foo']}. Cheers, -- - Martin Norland, Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital.