Skip to content

Commit

Permalink
Updated UpdateContact.php
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRiz15 authored Jan 24, 2024
1 parent 02db112 commit 074392c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions html/LAMPAPI/UpdateContact.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$inData = getRequestInfo();


$phoneNumber = $inData["phoneNumber"];
$emailAddress = $inData["emailAddress"];
$firstName = $inData["firstName"];
Expand All @@ -13,7 +14,6 @@
$newLastName = $inData["newLastName"];
$newCreatedByUserId = $inData["newCreatedByUserId"];
$newFriendshipLevel = $inData["newFriendshipLevel"];

$conn = new mysqli("localhost", "TheBeast", "WeLoveCOP4331", "COP4331");
if ($conn->connect_error)
{
Expand All @@ -25,9 +25,7 @@
$stmt->bind_param("ssissi", $firstName, $lastName, $createdByUserId, $phoneNumber, $emailAddress, $friendshipLevel);
$stmt->execute();
$result = $stmt->get_result();

if ($result->fetch_assoc()){
sendResultAsJson("hi");
$stmt = $conn->prepare("UPDATE Contacts SET FirstName=?, LastName=?, CreatedByUserID=?, PhoneNumber=?, EmailAddress=?, FriendshipLevel=? WHERE FirstName=? AND LastName=? AND CreatedByUserID=? AND PhoneNumber=? AND EmailAddress=? AND FriendshipLevel=?");
$stmt->bind_param("ssissississi", $newFirstName, $newLastName, $newCreatedByUserId, $newNumber, $newAddress, $newFriendshipLevel, $firstName, $lastName, $createdByUserId, $phoneNumber, $emailAddress, $friendshipLevel);
$stmt->execute();
Expand Down

0 comments on commit 074392c

Please sign in to comment.