Re: Returns Blank
| From: | David Kadlcak | Date: | Thu, 20 Jan 2005 17:14:15 +0000 |
| Subject: | Re: Returns Blank | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38231@lists.php.net to get a copy of this message | ||
check the query. make sure you're actually getting $user and $pass
variables. If not, you may need to do:
global $_POST;
$user=$_POST['user'];
$pass=$_POST['pass'];
.
.
.
> Date: Wed, 19 Jan 2005 22:50:49 -0500
> From: Squeakypants <squeakypants@gmail.com>
> To: php-db@lists.php.net
> Subject: Returns Blank
>
> 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");
>
> $query = "SELECT credits FROM krypto WHERE user = '" . $user . "' AND
> pass = '" . $pass . "'";
> $result = mysql_query($query);
>
>
> if (!$result) {
> echo 'Could not run query: ' . mysql_error();
> exit;
> }
> echo mysql_result($result, 3);
>
> mysql_free_result($result);
>
> mysql_close();
>
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo