Minor fixes and closing DB connections as needed
This commit is contained in:
@@ -1,27 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
$servername = "localhost";
|
||||
$username = "web";
|
||||
$password = "Password456";
|
||||
$dbname = "computer";
|
||||
<?php
|
||||
$servername = "localhost";
|
||||
$username = "web";
|
||||
$password = "Password456";
|
||||
$dbname = "computer";
|
||||
|
||||
// Create connection
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
// Check connection
|
||||
if (!$conn)
|
||||
{
|
||||
die("Connection failed: " . mysqli_connect_error());
|
||||
}
|
||||
// Create connection
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
// Check connection
|
||||
if (!$conn)
|
||||
{
|
||||
die("Connection failed: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO FriendList VALUES user1, argv[0], true";
|
||||
$result = mysqli_query($conn, $sql);
|
||||
$sql = "UPDATE FriendList SET confirm = true WHERE username = argv[0] and friend = user1";
|
||||
$result = mysqli_query($conn, $sql);
|
||||
?>
|
||||
$sql = "INSERT INTO FriendList VALUES user1, argv[0], true";
|
||||
$result = mysqli_query($conn, $sql);
|
||||
$sql = "UPDATE FriendList SET confirm = true WHERE username = argv[0] and friend = user1";
|
||||
$result = mysqli_query($conn, $sql);
|
||||
?>
|
||||
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
$db_connection = null;
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user