Update findFriend.php
This commit is contained in:
@@ -23,7 +23,8 @@
|
|||||||
$sql_statement = $sql_select." ".$sql_from." ".$sql_where."";
|
$sql_statement = $sql_select." ".$sql_from." ".$sql_where."";
|
||||||
if(($db_connection->query($sql_statement)) == 0)
|
if(($db_connection->query($sql_statement)) == 0)
|
||||||
echo "username doesn't exist";
|
echo "username doesn't exist";
|
||||||
|
else
|
||||||
|
{
|
||||||
$sql_select = "SELECT count(username)";
|
$sql_select = "SELECT count(username)";
|
||||||
$sql_from = "FROM friendList";
|
$sql_from = "FROM friendList";
|
||||||
$sql_where = "WHERE username = input and friend = ".$_SESSION["loggedInUser"]."";
|
$sql_where = "WHERE username = input and friend = ".$_SESSION["loggedInUser"]."";
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
$sql_statement = "INSERT INTO friendList VALUES (".$_SESSION["loggedInUser"].", input, false)";
|
$sql_statement = "INSERT INTO friendList VALUES (".$_SESSION["loggedInUser"].", input, false)";
|
||||||
$db_connection->query($sql_statement);
|
$db_connection->query($sql_statement);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
}catch(PDOException $e){
|
}catch(PDOException $e){
|
||||||
|
|||||||
Reference in New Issue
Block a user