php - Video Streaming Mysql Return -
mysql gives me 1 result, directorie, video. can shows 3 latest videos?
<?php $link = mysql_connect('mysql', 'user', 'pass'); if (!$link) { die('could not connect: ' . mysql_error()); } mysql_select_db(database); $sql = 'select * `videos`'; $result=mysql_query($sql); $row = mysql_fetch_array($result); echo $row['path']; mysql_close(); ?>
i don't know how database looks should order date (assuming use that) descending , limit 3
$sql = 'select * `videos` order creation_date desc limit 3';
http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html
http://dev.mysql.com/doc/refman/5.0/en/select.html
and put mysql_fetch_array in while loop
while(row = mysql_fetch_array($result)) { echo '<video width="320" height="240" controls> <source src="/upload/'.$row['path'].'"> browser not support video tag. </video> <br />'; }
and replace tag in page <?php require_once('sqlscript.php'); ?>
Comments
Post a Comment