When I'm doing this it can't handle the query line. When I change the :count to a number it works correctly.
So I want to know how can I use a string to determine a number for the mysql request.
Thank you!
<?php
// Error report
ini_set('display_errors', 1);
error_reporting(~0);
// Getting video ID from URL
$video = $_GET['v'];
// Including database connection
include 'db.php';
//$query = "SELECT file_name, videos FROM videos ORDER BY RAND() LIMIT 1;";
$query = "SELECT file_name, videos FROM videos LIMIT :count,1;";
// Prepare
$statement = $handler->prepare($query);
$statement->bindParam(":count",$video);
// Execute
$statement->execute();
// Fetch
$videos = $statement->fetch(PDO::FETCH_ASSOC);
$comment = $videos["file_name"];
$videos = $videos["videos"];
echo $comment;
echo $videos;
?>