So, just for the sake of me getting this right, it would be better code if i
had the code like this:

<?
$UserExists=mysql_query("select * from users where
username='$_POST[username]' and pwd=md5($_POST[password])");

//since query is done see if the user exists
if($UserExists) {
ExistingUserCanDoSomething(); }
else {
YouCantDoAnythingIfYouDontExist(); }
?>

forgive the odd severely long redundant example names but... im sure that is
better than what i had before...

let me know if i got the right idea...

and $UserExists in this example is either true or false because "empty set"
in mysql isnt even a number it = NULL

echo $UserExists;//prints 0 if false and 1 if true
//at least in this instance of it (normally it would return total rows
matched)

at the point of logins i dont care about the # of rows it will alwas return
0 or 1 so  true/false is best for me right now. when i create the user
generater then i will need to check for multiple usernames/passwords (2
users cant have the same pwd or id)...

anyways...off my box again

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to