Update findFriend.php

This commit is contained in:
Logan McInnis
2019-12-04 16:54:39 -05:00
parent e2a092ba9c
commit 00c0e459f2

View File

@@ -23,7 +23,8 @@
$sql_statement = $sql_select." ".$sql_from." ".$sql_where."";
if(($db_connection->query($sql_statement)) == 0)
echo "username doesn't exist";
else
{
$sql_select = "SELECT count(username)";
$sql_from = "FROM friendList";
$sql_where = "WHERE username = input and friend = ".$_SESSION["loggedInUser"]."";
@@ -40,6 +41,7 @@
$sql_statement = "INSERT INTO friendList VALUES (".$_SESSION["loggedInUser"].", input, false)";
$db_connection->query($sql_statement);
}
}
echo '</pre>';
}catch(PDOException $e){