php - converting from mysql to PDO username confirmation issue -
how convert mysql pdo? having issues trying code verify if username exists.
//check if user exists $u_check = mysql_query("select username users username='$un'"); //count amount of rows username = $un $check = mysql_num_rows($u_check); if ($check == 0) {
you'd want prepared statement
$u_check = $pdo->prepare("select username users username= :username"); $u_check->execute(array(':username' => $un)); if($u_check->rowcount()) {
Comments
Post a Comment