<?php global $db, $db_prefix, $websiteUrl; $srch = filter_input(INPUT_GET, 'srch'); $gpage = filter_input(INPUT_GET, 'page'); $num_rec_per_page = 10; $page = isset($gpage) ? $gpage : 1; $start_from = ($page - 1) * $num_rec_per_page; $querystr = "SELECT actor_id id,name title, headshot image,'actors' source FROM " . $db_prefix . "actors ac WHERE ac.name LIKE '%" . $db->sql_escape($srch) . "%' UNION ALL SELECT movie_id id,title title, poster image,'movies' source FROM " . $db_prefix . "movies mv WHERE mv.title LIKE '%" . $db->sql_escape($srch) . "%'"; $all = $db->sql_query($querystr); $pagi = new Pagination(); $pagi->setCurrent($page); $pagi->setIgnoreGet(true); $pagi->setTotal($all->num_rows); $pagi->setRPP($num_rec_per_page); $query = $db->sql_query("{$querystr} ORDER BY title ASC LIMIT {$start_from}, {$num_rec_per_page}"); include_once PATH . '/header.php'; ?> <main id="main"> <div class="container"> <div class="row"> <div class="col-sm-9"> <h2>Search Results for '<?php echo $srch; ?> '</h2> <?php if ($query->num_rows > 0) { echo '<div class="type_top"><table class="table table-fixed table-striped">'; $count = $start_from; while ($row = $query->fetch_object()) {