} $orderby = " ORDER BY id desc"; $sql = "SELECT * FROM toy " . $queryCondition; $paginationlink = "getresult.php?page="; $page = 1; if (!empty($_GET["page"])) { $page = $_GET["page"]; } $start = ($page - 1) * $perPage->perpage; if ($start < 0) { $start = 0; } $query = $sql . $orderby . " limit " . $start . "," . $perPage->perpage; $result = $db_handle->runQuery($query); if (empty($_GET["rowcount"])) { $_GET["rowcount"] = $db_handle->numRows($sql); } $perpageresult = $perPage->perpage($_GET["rowcount"], $paginationlink); ?> <form name="frmSearch" method="post" action="index.php"> <div class="search-box"> <p><input type="hidden" id="rowcount" name="rowcount" value="<?php echo $_GET["rowcount"]; ?> " /><input type="text" placeholder="Name" name="name" id="name" class="demoInputBox" value="<?php echo $name; ?> " /><input type="text" placeholder="Code" name="code" id="code" class="demoInputBox" value="<?php echo $code; ?> " /><input type="button" name="go" class="btnSearch" value="Search" onclick="getresult('<?php
?> </div> <div id="tutorial-<?php echo $tutorial["id"]; ?> "> <input type="hidden" id="likes-<?php echo $tutorial["id"]; ?> " value="<?php echo $tutorial["likes"]; ?> "> <?php $query = "SELECT * FROM ipaddress_likes_map WHERE tutorial_id = '" . $tutorial["id"] . "' and ip_address = '" . $ip_address . "'"; $count = $db_handle->numRows($query); $str_like = "like"; if (!empty($count)) { $str_like = "unlike"; } ?> <div class="btn-likes"><input type="button" title="<?php echo ucwords($str_like); ?> " class="<?php echo $str_like; ?> " onClick="addLikes(<?php echo $tutorial["id"]; ?> ,'<?php