function username_exists($username){
global $db;
$sql = "SELECT 'username' FROM users WHERE 'username' = '$username'";
$result = mysqli_query($db, $sql);
confirmquery( $result );
if (mysqli_num_rows($result) > 0) {
return true;
}else {
return false;
}
}
if(username_exists($username)){
$error['username'] = 'Username already exists';
}
Passy 0 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
Dani 4,329 The Queen of DaniWeb Administrator Featured Poster Premium Member
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.