How can I update my code to PDO using either mysqli ? Thanks in advance for your valuable answers.
<?php
$categories = mysql_query("SELECT * FROM (SELECT * FROM tubecatget ORDER BY RAND() LIMIT 32) AS `random_pages` ORDER BY catviews DESC");
while($row = mysql_fetch_array($categories))
{
$movtitles=$row['cattitle'];
$id=$row['id'];
$seo=$row['catseo'];
$top_video = mysql_query("SELECT vidthumb FROM tubevideos WHERE vidcat='$id' ORDER BY vidviews DESC, id DESC LIMIT 1");
while ($thumb = mysql_fetch_array($top_video))
$link=$thumb['vidthumb'];
?>
<?php echo '<a title="'.$movtitles.'" href="'.$seo.'.html"><img src="'.$link.'" width="240" height="180" alt="'.$seo.'" />';?><span><?php echo $movtitles;?></span></a>
<?php } ?>