Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql query for login with email or username

if($_POST['username'] != '' && $_POST['password'] != ''){$name = $_POST['username'];$pass = md5($_POST['password']);$check_email = Is_email($name);if($check_email){// email & password combination$query = mysql_query("SELECT * FROM `users` WHERE `email` = '$name' AND `password` = '$pass'");} else {// username & password combination$query = mysql_query("SELECT * FROM `users` WHERE `username` = '$name' AND `password` = '$pass'");}$rows = mysql_num_rows($query);if($rows > 0){//successfull login$_SESSION['username'] = $name;} else {$msg = "Invalid Login Credentials";}mysql_close($connection);} else {$msg = "Please Provide All Details";}
Comment

PREVIOUS NEXT
Code Example
Sql :: sql tablo sp 
Sql :: get employees if not contains in sql 
Sql :: python mysql github 
Sql :: BigQuery define array varriable 
Sql :: add two days to current date in sql when creating tables 
Sql :: Select all columns except one in MySQL? 
Sql :: mysql server on and off 
Sql :: laravel How to find the password of mysql on desktop docker in laravel 
Sql :: mysql database hyphen 
Sql :: Object Information 
Sql :: hive batch drop table 
Sql :: how to change the field size of an existing column 
Sql :: get who is hired in february in sql 
Sql :: find class =5 from list 
Sql :: SQL Backup Only New Changes in SQL 
Sql :: ring close the connection to the database using the odbc_disconnect() 
Sql :: how to user id to show in from date to upto date in mssql server 
Sql :: python and mysql connectivity 
Sql :: subquery 
Sql :: mysql 
Sql :: list databases in sql server 
Sql :: flask sqlalchemy session delete 
Sql :: pl sql call web service 
Csharp :: how to lock and hide a cursor unity 
Csharp :: c# hello world program 
Csharp :: Unity Make a 2D object look at the mouse position 
Csharp :: check if string is email c# 
Csharp :: c# copy file to directory 
Csharp :: change height of rect transform unity 
Csharp :: how to change the color of your text in c# 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =