Lots of people told me about the quote issue. Thanks!
One more thing, how do you encrypt a string into the password. In the
mysql database it is interperated as a password, so it is a different
combination than the actual password. How do I do this in php?
--
PHP Database Mailing List
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.
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
Try this
$query = SELECT credits FROM krypto WHERE user='$user' AND pass='$pass';
That should work better then the original query...
Best regards
Andi
Squeakypants schrieb:
From a forum that recommended this to me, I changed the query execution to this:
$query = SELECT credits FROM krypto WHERE
Squeakypants wrote:
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
PROTECTED]
Reply-To: Squeakypants [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] 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
Squeakypants ha scritto:
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 =
Personally, I would interpolate the $query and $user string like so:
$query = SELECT credits FROM krypto WHERE user='.$user.' AND
pass='.$pass.';
Always works for me...
rgd
chris r.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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 =