|
Posted by Colin McKinnon on 02/17/07 13:50
phyburn wrote:
> It seems there is something wrong with my script for the reason that
> it always returns, UserName NOT found . I know it connects to the db
> fine because I don't get a error. So just been trying to figure out
> what's wrong. I am using PEAR btw.
>
By the time it got to me this had some very unusual formatting - I'd
recommend sticking to the PEAR style guidelines, particularly when posting
to newsgroups.
> if(array_key_exists("$user", $rows)){
> print "<p><b>UserName AcceptED</b>";
You should be looking for a value, not a key - and getAll returns a nested
array - i.e. somewhere there should be...
$rows[$row_number]['username']==$user
But really you should be checking this in the SQL - not loading a list of
all users then checking in PHP.
C.
[Back to original message]
|