Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("sql.php");
- session_start();
- $email = $_SESSION['uid'];
- if(isset($_POST['down'])){
- $down = $_POST['down'];
- }
- if(isset($_POST['up'])){
- $up = $_POST['up'];
- }
- $type = $_GET['type'];
- $date = null;
- if(!$type == "return"){
- $smt = $db->prepare("UPDATE downup SET user = ?, down = ?, up = ? WHERE user=?");
- if($smt->execute(array($email, $down, $up, $email))){
- echo "done";
- }
- } else if ($type == "return") {
- $smtR = $db->prepare("SELECT * FROM downup WHERE user=? LIMIT 4");
- $smtR->execute(array($email));
- $resul = json_encode($smtR->fetchAll());
- echo $resul;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement