PHP Classes

File: ajax/addDuration.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Netflix Clone   ajax/addDuration.php   Download  
File: ajax/addDuration.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Netflix Clone
Manage a library of movies to rent like Netflix
Author: By
Last change:
Date: 2 months ago
Size: 790 bytes
 

Contents

Class file image Download
<?php
require_once("../includes/config.php");

if(isset(
$_POST["videoId"]) && isset($_POST["username"])) {
   
$query = $con->prepare("SELECT * FROM videoProgress
                            WHERE username=:username AND videoId=:videoId"
);
   
$query->bindValue(":username", $_POST["username"]);
   
$query->bindValue(":videoId", $_POST["videoId"]);

   
$query->execute();

    if(
$query->rowCount() == 0) {
       
       
$query = $con->prepare("INSERT INTO videoProgress (username, videoId)
                                VALUES(:username, :videoId)"
);
       
$query->bindValue(":username", $_POST["username"]);
       
$query->bindValue(":videoId", $_POST["videoId"]);
   
       
$query->execute();
       
    }
}
else {
    echo
"No videoId or username passed into file";
}
?>