Hello im trying to implant PDO into my login script to make it safrer from sql injection. But im getting a white page i think its because im trying to count the rows to see if
There's couple of things in your code that sticks in the eyeball.
If you pasted the whole script here, you're missing session_start(). I don't know what's in your home.php, but if it's content generation depends on a value in $_SESSION['username'], it's never going to happen because it will be empty after the header redirection.
Take a look at the manual about session_start().
Also, as stated:
For most databases, PDOStatement::rowCount() does not return the number of rows affected by a SELECT statement.
Just in case thought to mention this. I've spent some good amount of time in the past wondering this thing myself.
You might want to take a glance at example #2 on the manual about rowCount.
And of course, as @Paul already pointed, you shouldn't be using mysql_query() anymore if migrating to PDO.