When I insert a new data I want to check whether user already exist and also I want to take the last inserted record number and increment it by one. How can I check both conditions in one select statement? This is my code.
Code:
$result = pg_query($dbconn, "SELECT \"No\",\"Name\" FROM \"User\" ORDER BY \"No\" ASC;");
while($row = pg_fetch_array($result)){
$Name=$row['Name'];
if($Name==$FullName)
{
echo "User already exist!";
}
}
Comment