Koozali.org: home of the SME Server

slightly off topic

brad wright

slightly off topic
« on: July 17, 2001, 12:54:29 PM »
Hi all,
 Im developing a PHP/mySQL application on an e-smith (4.1.2) box. I have a situation where I am verifying a username/password system, and I need to select all rows in a table (login_table) which have the value password('$variable') in the 'Pass' column.

my code to extract this looks like:

$testResult = mysql_query("SELECT * FROM login_table  
                     WHERE Pass = password('$Pass')") or die ("ouch2");

$num_rows = mysql_num_rows($testResult);


the numrows result is always = 0 when i run this, but i KNOW there is a row in the table with the value i am testing for.

Does anyone know why this is happening? Is it PHP syntax or a peculiarity of the e-smith server (hence my post in this forum).

I realise its off-topic and I apologise, but I just wondered if its e-smith configuration related. I get NO error messages, but i always get a value of 0 for $num_rows.

help!!! Its been holding mne up all day.

Thanks in advance,
Brad

Alex Wallace

Re: slightly off topic
« Reply #1 on: July 17, 2001, 06:00:53 PM »
As far as I can see, you are missing to pass the Database variable to your
resultset variable to open the resultset, you need to put a , $db) after
the sql string...

Also, have you tryed echoing your string and run it against mysql using
the mysql client?

The following line works here fine:

 $rsPassword = mysql_query("SELECT * FROM tblDealers WHERE  Password = password('$CurrentPassword')",$db);

Hope that helps...