OK, here is the code that it really works, and finally, after a few hours to look around and mix the answers to some answers, this is the one that will actually return the score to your select statement. SQL is the select statement, obviously $ username1 is the text field message for the username. $ password1 is the same as setting a username. Other than that, you should have everything you need to make it work, instead of your variables instead of mine. Hope this saves some people when I searched, trying to get exactly what I wanted here. This solution is for when you have a select statement and you want to be able to continue or stop returning it.
SQL = 'SELECT * from Users WHERE Username = :Username AND Password = :Password'; STH = $conn->prepare($SQL); STH->bindParam(':Username', $username1); STH->bindParam(':Password', $password1); STH->execute(); STH->setFetchMode(PDO::FETCH_ASSOC); row_count = $STH->rowCount();
source share