Skip to main content
Inspiring
June 18, 2008
Question

User Authetication in PHP question

I have a user authentication problem, and don't know what to try next.
Here's my code -

$LoginRS__query=sprintf("SELECT UserName, UserPassword, UserIsAdmin FROM
users WHERE UserName=%s AND UserPassword=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password,
"text"));
$LoginRS = mysql_query($LoginRS__query, $connADT) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
die(mysql_num_rows($LoginRS)?'TRUE':'FALSE');

If I die($LoginRS__query), copy the string, and use a manual MySQL query to
search the database with it, it succeeds, and finds the proper record.

As you can see from the code, I also have a die(mysql_num_rows($LoginRS)),
and that returns a FALSE!

What the heck?


--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


This topic is closed to new replies. Start a new post to keep the conversation going.

11 replies

Inspiring
June 18, 2008
"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:g3b12g$q9d$1@forums.macromedia.com...
>I have a user authentication problem, and don't know what to try next.

I would try ColdFusion if I was you :-))

Massimo


Translate