And it happends again!

The idea with my site is that your suppost to register, and then get some friends, send emails to other persons that are registred at my site.
Problem nr.1
But now it seems like ive got problem again. First of all, if your new at my site and whant to register you clik the link that says
här,
then youll been taken to the "register part". But when i fill out my username and password i´ve been taken to the inloggpart, but it says
Du är nu utloggad, välkommen tillbaka! (You have been outlogged, welcome back!)
Problem nr.2
If i fill out wrong username or password, there shall come an errormsg that say
Wrong username or password!. But instead i got an php errormsg, that says:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\program\apache group\apache\htdocs\xzone\dologin.php on line 6
Warning: Cannot add header information - headers already sent by (output started at c:\program\apache group\apache\htdocs\xzone\dologin.php:6) in c:\program\apache group\apache\htdocs\xzone\dologin.php on line 8
ive cheched the code, but i cant figgur it out, so im turning to you guys, one more time
