List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 20 2000 3:31am
Subject:Re: Phantom Results
View as plain text  
At 4:51 PM -0400 2000-07-19, Rob Iten wrote:
>I'm using SELECT * FROM accounts WHERE login = '$login' AND password =
>'$password' to check if the login and password combination is correct.  When
>I enter it straight in MySQL, I get the correct result, but when I call it
>from a PHP script, it returns the value 2 even if there are not two
>corresponding records.  Does anyone have any ideas?


You're probably looking at the return value from mysql_query()
and not actually fetching the rows of the result.

mysql_query() returns a result identifier, not a result set.
Most likely you need to call mysql_fetch_array() or a similar
function to retrieve the rows.

-- 
Paul DuBois, paul@stripped
Thread
Phantom ResultsRob Iten19 Jul
  • Re: Phantom ResultsPaul DuBois20 Jul
  • Re: Phantom ResultsMartin Cameron20 Jul
  • RE: Phantom ResultsCraig Vincent20 Jul