Hello Forum:
I'm just now trying to learn PHP and read that using PDO was a better way to utilize online databases. I have my Registration page completed, storing client info in a MySQL db, all done using PDO. However, I'm having a little trouble with the Login page. I don't know if I'm using the PDO stuff the right way.
$stmt = $db->prepare('SELECT (username, password) FROM members WHERE (username) LIKE ? AND (password) LIKE ?');
$stmt->bindValue(1, "%$uname%", PDO::PARAM_STR);
$stmt->bindValue(2, "%$pwd1%", PDO::PARAM_STR);
$stmt->execute();
echo $affected_rows = $stmt->rowCount();
I'm not sure if I have the bindValue statements right, and I'm only assuming (hence the echo statement) that, if this is a valid username and password, one row will be affected. Like I said, I'm new to PHP, and this is my second day. So I imagine I have this code all wrong. Can someone set me on the right track? Much appreciated.
~Landslyde