Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to check if username already exists in php

$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$email = $_POST["email"];
$pass = $_POST["password"];

$check_email = mysqli_query($conn, "SELECT Email FROM crud where Email = '$email' ");
if(mysqli_num_rows($check_email) > 0){
    echo('Email Already exists');
}
else{
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $result = mysqli_query($conn, "INSERT INTO crud (Firstname, Lastname, Email, Password) VALUES ('$firstname', '$lastname', '$email', '$pass')");
}
    echo('Record Entered Successfully');
}
Comment

php check if user exists in database

$q = mysql_query("SELECT username FROM User WHERE username=$username", $cnn); if (mysql_num_rows($q) != 0) { echo "Username exists"; } else { echo "Write your code here"; }
Comment

PREVIOUS NEXT
Code Example
Php :: laravel access request in provider 
Php :: substr php 
Php :: wordpress limit post content length 
Php :: The "AppEntity entity has a repositoryClass set to but this is not a valid class. 
Php :: count column eloquent laravel 
Php :: text or description laravel database column type 
Php :: api symfony 4 @ApiResource 
Php :: insert into laravel 8 
Php :: laravel if else condition in blade file 
Php :: laravel permission 
Php :: laravel add request 
Php :: laravel carbon date format 
Php :: laravel controller constructor auth user null 
Php :: wp_query first post 
Php :: laravel uuid not showing in query 
Php :: orderby not working with groupby laravel 
Php :: laravel pdf export 
Php :: php sort time 
Php :: change verify email template laravel 
Php :: epoch conversion php 
Php :: php get last day of month 
Php :: Laravel - Add conditional where clause in query 
Php :: string length laravel validation 
Php :: laravel collection methods 
Php :: sanctum laravel 
Php :: php into javascript 
Php :: laravel request file empty 
Php :: Keep values in search form after submit 
Php :: quitar html con laravel 5 
Php :: trova corrispondenza nella stringa php 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =