Re: Returns Blank

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

 



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@xxxxxxxxx>
> To: php-db@xxxxxxxxxxxxx
> 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 

-- 
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