/** * @return bool */ public function insertJobs() { $response = $this->getResponse(); $connection = DatabaseConnector::getConnection(); if (!isset($response->jobs) || !$response->jobs) { return false; } foreach ($response->jobs as $job) { $preparedStatement = $connection->prepare($this->insertQuery); $preparedStatement->bindParam(':name', $job->name); $preparedStatement->bindParam(':status', $this->getStatusByColor($job->color)); $preparedStatement->bindParam(':created_at', date('Y-m-d H:i:s')); $preparedStatement->execute(); } return true; }
<?php include 'connect.php'; $dc = new DatabaseConnector(); $con = $dc->getConnection(); include 'functions.php'; $action = $_GET['action']; $user = $_GET['user']; $my_id = $_SESSION['user_id']; if ($action == 'send') { mysqli_query($con, "INSERT INTO frnd_req VALUES('', '{$my_id}', '{$user}')"); } if ($action == 'accept') { mysqli_query($con, "DELETE FROM `frnd_req` WHERE `from`='{$user}' AND `to`='{$my_id}'"); mysqli_query($con, "INSERT INTO friends VALUES ('','{$user}', '{$my_id})"); } if ($action == 'unfrnd') { mysqli_query($con, "DELETE FROM friends WHERE(user_id='{$my_id}' AND friend_id='{$user}') OR (user_id='{$user}' AND friend_id='{$my_id}')"); } header('Location: profile,php?user=' . $user);
<?php require_once 'php/DatabaseConnection.php'; $connect = new DatabaseConnector(); $connect->connect(); $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_SPECIAL_CHARS); $country = $_POST['country']; $state = $_POST['state']; $city = $_POST['city']; $accounttype = $_POST['accounttype']; $email = $_POST['email']; $password = $_POST['password']; $hashedPass = md5($password); if (isset($_POST)) { $sql = "INSERT INTO members VALUES('{$username}','{$country}','{$state}','{$city}','{$accounttype}','{$email}','{$hashedPass}', now())"; $connect->getConnection()->query($sql); $id = $connect->insert_id; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title>Activation Tester | Rolando Moreno | Full Stack Web Developer</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!-- Bootstrap -->