Hello, I have a products page which lists the pics of the products. I added pagination with bootstrap classes. I have 10 products in my database. I want to limit per page to display only 6 so then the second page should display 4. The issue im facing now is that the second page button doesn't "change" to the second page. but if i click >> button it does change. pic for visualization: ![1.JPG](/attachments/large/4/f576dd88594468eb6302102f5b57891b.JPG "align-center") code: $per_pageAll = 6; if (isset($_GET["page"])) $pageAll = $_GET["page"]; else $pageAll = 1; $start_fromAll = ($pageAll-1) * $per_pageAll; $stmtAll = $conn->prepare("SELECT id, name, price, type, …

Member Avatar
Member Avatar
+0 forum 1

Hi. can someone help me with my problem regarding search function, i have hard time knowing where to insert my if(isset($_POST['search'])).................and so on codes within my phpfile. here is my code, (pagination working) <?php $sql = "SELECT COUNT(user_id) FROM view_onse_officers"; $query = mysqli_query($db_conx, $sql); $row = mysqli_fetch_row($query); $rows = $row[0]; $page_rows =10; $last = ceil($rows/$page_rows); if($last < 1){ $last = 1; } $pagenum = 1; if(isset($_GET['pn'])){ $pagenum = preg_replace('#[^0-9]#', '', $_GET['pn']); } if ($pagenum < 1) { $pagenum = 1; } else if ($pagenum > $last) { $pagenum = $last; } $limit = 'LIMIT ' .($pagenum - 1) * $page_rows …

Member Avatar
Member Avatar
+1 forum 4

I want to make pagination for videos since i have much videos and i cannot load all in the same page, i have a function which displays all videos in the directory and than i limited it only to show first 6. How do i make the pagination so when im on page 2 to show the next 6 videos ? here is the full function function video($path) { $folder = "videos/$path"; $i = 0; if (is_dir($folder)) { if ($handle = opendir($folder)) { while (($file = readdir($handle)) != FALSE) { if ($file === "." || $file === ".." || $file …

Member Avatar
Member Avatar
+0 forum 2

When I use pagination for custom post type 'product' its working fine but its not working for the categories of custom post type. for ex. pagination working for this **'http://localhost/wordpress/products/page/2/'** and not for this **'http://localhost/wordpress/products/landscape/page/2/'** its always showing the first page content. How to solve this? given below is my code. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'product', 'posts_per_page' =>1,'taxonomy' =>'product_cat','term' => $cat_name1,'orderby'=>'post_date','page'=>$paged ); $wp_query = new WP_Query($args); if($wp_query->have_posts()) : while ($wp_query->have_posts()): $wp_query->the_post(); <div class="product_list"> <?php the_title();?> </div> <?php endwhile; ?> <?php wp_pagenavi( array( 'query' => $wp_query ) );//plugin code ?> <?php else : …

Member Avatar
Member Avatar
+0 forum 1

Hi can any one please help me with some sample for multiple textbox value in php search. all the fields in the search are in one table. I have attached screen for the reference. ![a4ec5f0f3cab021bb2e13c6b18d4c008](/attachments/small/3/a4ec5f0f3cab021bb2e13c6b18d4c008.JPG "align-left")

Member Avatar
Member Avatar
+0 forum 6

I found this [jQuery Plugin](http://jsfiddle.net/ZdCPs/4/) online. The plugin is exactly what I need and I want to add it to my page but my table is created by obtaining the elements from a db. I tried adding it to the page as the jsFiddle sample but pagination just does not show. The only change I am making to the jsFiddle code is the instead of breaking the pages every tbody element I want it to break it every tr element. Here is the code for the table, any suggestion is welcomed. var columns = ["username", "user_id", "address", "state", "postal_code", "phone", …

Member Avatar
Member Avatar
+0 forum 3

I've got a problem with my pagination with one of my components on my Joomla 2.5 website. I no longer have a subscription with the developers so they won't help me. Basically the pagination in this component is vertical instead of horizontal, as in the picture below. ![pagination.PNG](/attachments/large/3/39807112133f3356027c716834f3863e.PNG "align-center"). I've tried it with the default joomla templates and the problem remains, however the pagination in the rest of the joomla site (such as in articles) is fine, this leads me to believe that it's something in the component CSS that is causing the trouble, but I can't locate the problem …

Member Avatar
Member Avatar
+0 forum 11

[CODE=php] <?php //get the variables $var = $_POST['query'] ; $trimmed = trim($var); $table = $_POST['table']; //make connection $conn = mysql_connect('localhost','root','123') or die("Error:".mysql_error()); mysql_select_db('sutilities',$conn) or die("Error:".mysql_error()); //delete temp search table $del_table = "drop table search"; #mysql_query($del_table) or die ("Error:".mysql_error()); // Create a MySQL table in the selected database #mysql_query("CREATE TABLE search( #id INT NOT NULL AUTO_INCREMENT, ##PRIMARY KEY(id), # table_queried VARCHAR(30), # trimmed varchar(200))") # or die(mysql_error()); mysql_query("insert into search (table_queried, trimmed) values ('$table','$trimmed')") or die ("Error:".mysql_error()); // find out how many rows are in the table $query = "SELECT COUNT(*) FROM $table"; $result = mysql_query($query, $conn) or die("Error:".mysql_error()); $r = …

Member Avatar
Member Avatar
+0 forum 6

Hello everyone, I want to make a website for movies, can any one tell me how can i do the followings .... 1 - will i use xml file for movie path? if yes then how can i use xml file. 2 - is this possible that the record of a movie should be in a database. 3 - i want to show only 10 movies on one page, after that pagination will start, how can i do this in php... thanks

Member Avatar
Member Avatar
+0 forum 2

I have a simple form to search a table for the search term entered into that form. $query = $_GET['term']; $min_length = 1; if(strlen($query) >= $min_length){ $query = htmlspecialchars($query); $query = mysqli_real_escape_string($link, $query); } Here the variable 'query' is the search query posted using the get method from the form. The query for the database looks like this $sql=mysqli_query($link, "SELECT COUNT(id) FROM products WHERE `name` LIKE '%".$query."%' OR `brand` LIKE '%".$query."%' OR `description` LIKE '%".$query."%' OR `spec` LIKE '%".$query."%' OR `category` LIKE '%".$query."%' OR `subcategory` LIKE '%".$query."%' AND status = 1 ORDER BY id DESC") OR die(mysqli_error($link)); So this works …

Member Avatar
Member Avatar
+0 forum 4

Hello! I have a problem with sorting mysql queries into pages. So i wanna set every query that is passed to screen to be divided with 30 rows per page. Here is what i come up with: <?php $con=mysqli_connect("*","*","*","*"); // MySQL connect if (mysqli_connect_errno()) { echo "MySQL: no connection! " . mysqli_connect_error(); } $order = $_GET['order']; $clid = $_GET['clid']; //if (isset($_GET["order"])) { $page = $_GET["order"]; } else { $order='calldate'; }; $queue = $_GET['queue']; $desc = $_GET['desc']; $fromdate = $_GET['fromdate']; $todate = $_GET['todate']; $agent = $_GET['agent']; //if (isset($_GET["desc"])) { $page = $_GET["desc"]; } else { $order='DESC'; }; if (isset($_GET["page"])) { $page …

Member Avatar
Member Avatar
+0 forum 1

I am trying to make it so that the snippet below automatically creates extra pages to show me all the followers I have on my Twitch Channel. At the moment I have it at 25, but it does cap at 100. How can I make it so that it automatically populates the table? <?php $json = json_decode(file_get_contents("https://api.twitch.tv/kraken/channels/greatbritishbg/follows?limit=25")); $i = 0; // Use http://json.parser.online.fr/ to get the string parse of the Json_Decode echo "<table><tr>"; echo "<th>Username:</th>"; echo "<th>Follow Date:</th>"; echo "<th>Type:</th>"; echo "<th> </th>"; echo "</tr>"; foreach($json->follows as $follow) { $i++; echo "<tr>"; echo "<td><a href='" . $follow->user->_links->self . "'>" . …

Member Avatar
Member Avatar
+0 forum 1

**Problem** I need an jax pagination in YII, The problems are * its not showing the required results for the first time. ie. it is showing the complete result * When clicked on more, it again shows the complete result below that section as it is **What Needed** * i need to show, say 5 records for the first time * load the remaining results (5 rows) once clicked on more and so on **My Wordkout** **ControllerAction** public function actionShopStoresByCategory($storecategory, $affusername = NULL) { $this->ticker_news = NewsTicker::model()->getTickerNews(); if (!empty($affusername)) $this->VarifyUser($affusername); $this->layout = "layout_home"; $model = new Stores(); $criteria = new …

Member Avatar
+0 forum 0

Here is online demo - http://cs-bg.info/news/archive/ I want to show my news like that. (like archive for each year) I want to work with epoch time. Thanks for any help.

Member Avatar
Member Avatar
+0 forum 3

<div class="datagrid"><table> <thead><tr><th>header</th><th>header</th><th>header</th><th>header</th></tr></thead> <tfoot><tr><td colspan="4"><div id="paging"><ul><li><a href="#"><span>Previous</span></a></li><li><a href="#" class="active"><span>1</span></a></li><li><a href="#"><span>2</span></a></li><li><a href="#"><span>3</span></a></li><li><a href="#"><span>4</span></a></li><li><a href="#"><span>5</span></a></li><li><a href="#"><span>Next</span></a></li></ul></div></tr></tfoot> <tbody><tr><td>data</td><td>data</td><td>data</td><td>data</td></tr> <tr class="alt"><td>data</td><td>data</td><td>data</td><td>data</td></tr> <tr><td>data</td><td>data</td><td>data</td><td>data</td></tr> <tr class="alt"><td>data</td><td>data</td><td>data</td><td>data</td></tr> <tr><td>data</td><td>data</td><td>data</td><td>data</td></tr> </tbody> </table></div> CSS .datagrid table { border-collapse: collapse; text-align: left; width: 100%; } .datagrid {font: normal 12px/150% Arial, Helvetica, sans-serif; background: #fff; overflow: hidden; border: 1px solid #36752D; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .datagrid table td, .datagrid table th { padding: 3px 10px; }.datagrid table thead th {background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #36752D), color-stop(1, #275420) );background:-moz-linear-gradient( center top, #36752D 5%, #275420 100% );filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#36752D', endColorstr='#275420');background-color:#36752D; color:#FFFFFF; font-size: 15px; font-weight: bold; border-left: 1px solid #36752D; } .datagrid …

Member Avatar
Member Avatar
+0 forum 9

Recently i've rewritten my code to PDO from mysql query. Insert, fetch, update, delete everything working fine. But, pagination not displaying in my page. Before i've used mysql query. In that time pagination worked perfectly. Now, i've changed my codes into prepared statements. pagination not dispalying i don't know what should i do? Below i've posted my coding (pagination only)... <?php include('config.php'); include('paginate.php'); $per_page = 10; try { //some codes } catch(PDOException $e) { //some codes } $total_results = $stmt->fetchColumn(); $total_pages = ceil($total_results / $per_page); if (isset($_GET['page'])) { $show_page = $_GET['page']; if ($show_page > 0 && $show_page <= $total_pages) { …

Member Avatar
Member Avatar
+0 forum 1

Hey Experts >>>>> Please help me out .... i want this type of grid to be generated horizontally ... but unfortunately in asp.net gridview is not showing horizontal options ..... another interesting fact is that all the products shown in this page is UNIQUE ... and Pagination is also included ... how ??? please help me ... here is the link www.mxonline.com.pk check its center product grid on the main page .... i want to use SQL database in this project . someone told me to use datalist ... but "if for e.g there are 20 unique products showing on …

Member Avatar
Member Avatar
+0 forum 1

How to give pagination to database and retrive the data on same form

Member Avatar
Member Avatar
+0 forum 1

Hi can any one give the idea of the pagination system ? I mean thea functions that I should use to get a good pagination system.What I reached so far is this : I should request the number of rows from the database.Then I should make a variable which contains the number of results in every page.Then I do the math.But my problem is how to distribute the results on the pages and how to show the page numbers as links.

Member Avatar
Member Avatar
+0 forum 1

I am attemping to paginate for a public salaries database I am building for my newspaper. I have the code figuring out that it should only display X rows, however, each page displays the same rows. I also have noticed that clicking the links I've created for Previous/Next Page only adds an extra ?page= string to the URL. So, things like ?selID=3?page=1?page=2?page=2?page=2 are occuring when you press the next page button (every time it is pressed, another ?page=2 is added). Here is the full code: <?php $link = mysql_connect('LINK', 'USER', 'PASS'); if (!$link) { die('Server Connection Failed : ' . …

Member Avatar
Member Avatar
+0 forum 2

Hello everyone, I have a table that i want to limit to 10 results per page and have a simple pagination script to generate the next 10 results. I have tried many different options, but alas it does not work. here is what I have so far. <tbody> <? //specify how many results to display per page $limit = 10; //get pagination $s = mysql_real_escape_string($_REQUEST['s']); $results = mysql_query("SELECT * FROM products ORDER BY id LIMIT $s,$limit"); $row_num_links_main =mysql_num_rows ($results); $n=0; while($row = mysql_fetch_array($results)){ ?> <tr> <td><? echo $n=$n+1 ?></td> <td><? echo $row['itemnumber']?></td> <td><a href="?editproduct=<? echo $row['id'] ?>"><? echo $row['productname'] ?></a></td> …

Member Avatar
Member Avatar
+0 forum 1

I have a page with a menu of categories and subcategories of products. Categories have a class 'category' and subcategories have a class 'subcategory'. When either is clicked some AJAX sends the category to some php to compile the html which the AJAX then sends back to the page to populate a div. This part works fine. There is a function in the code to split the returned records. So say there are 6 records and the page is to show 2 at a time then there are 3 pages. I get the correct amount of pages displayed(1 2 3) …

Member Avatar
Member Avatar
+0 forum 10

I have one html table on few pages(100 rows per page). Is there a way to load (not the initial first page) a page with specific row on it (if id of that row is defined)?

Member Avatar
Member Avatar
+0 forum 1

Hello All ! I want to make my gridview pagination look like this First -prev -- 1 -2 -3 -4 -Next -Last How can i do this , by using options of Mode it is not possible. Best Regards

Member Avatar
Member Avatar
+0 forum 2

Hi mates, I am looking for a way to cache a PHP page that it's different for each session user. For example if the paginating is used and if I have 10 pages each page contains 25 entries extracted from database, also these entries are editable when clicking on button on the page, how can I add these pages to cache? What's the best concept? I know the Jstorage ([url]www.jstorage.info[/url]) but I am not sure if it works in this case? I tried the caching in PHP but the problem it works on server side when creating html cache file …

Member Avatar
Member Avatar
+0 forum 1

hello, i'm using this pagination script and it works smoothly , but i want to display products when i pressed my category menu(php created), this is the code ,i'm trying configure pagination with my category menu, but it's not working. please help me. i'm newbie in php. <?php include('connect.php'); if(isset($_GET['category'])) { $category=$_GET['category']; $qry="select * from datas_disp where category=$category ORDER BY ID DESC"; $res=mysql_query($qry); $tableName="$res"; // if i pressed categorm menu "$tableName" want to get the category number and fetch datas from "datas_disp(table name)" , means at normal case datas fetch through the default pagination script($tableName="datas_disp";), but at the time of …

Member Avatar
Member Avatar
+0 forum 3

I am unable to maintain a GET variable with this pagination script. Was hoping you all could help. I am using a GET function so the user can choose which categories are displayed. I'm using a pagination script I found online and I am now confronted with this issue, when I choose "page 2" $dynCat no longer is parsed in the URL because the pagination script creates a new URL and uses GET also. Could someone help me out with using pagination with a variable query? Thank you. ERROR Notice: Undefined index: dynCat ----/dynCat.php on line 32 I understand why …

Member Avatar
Member Avatar
+0 forum 1

Hello, i want to change te result of showing in the browser, now it shows this when i click 2 3 4 or next. Search+source+code&page=36 Search+source+code&page=72 Search+source+code&page=108 and i want to change it to this, Search+source+code&page=2 Search+source+code&page=3 Search+source+code&page=4 If i change $per_page = 36; to $per_page = 1; than works everything fine but than i dont have 36 videos but 1. and i want to show 36 videos, here below is the complete script. <?php $button = $_GET ["submit"]; $search = $_GET ["search"]; if(strlen($search)<=1) echo "Search term too short"; else{ echo "You searched for <b>$search</b> <hr size='1'></br>"; mysql_connect("mysql_host_name","mysql_username","mysql_password"); mysql_select_db("database_name"); $search_exploded …

Member Avatar
Member Avatar
+0 forum 9

Hi, I am very new to PHP, and i need small help. i need to fetch data on selection box onchange event and then apply pagination to the results. i have done etching data with ajax and when i tried applying pagination i am unable to load parent page of the ajax page. here is the code follows.please help me to solve this problem. <?php include('auth.php'); $id=$_GET["id"]; //for pagination define('MAX_REC_PER_PAGE', 10); $qry ="SELECT count(*) from user_info,time_data where user_info.user_id = time_data.user_id and manager_id= '$timeapp_id' "; if($id != 0){ $qry = $qry." and user_info.user_id = '$id'"; } $results = mysql_query($qry); list($total) = …

Member Avatar
Member Avatar
+0 forum 2

I'm getting stuck with this code. I'm not getting data in second page after form submit. <?php session_start(); $user = $_GET['Type']; include "mysqlConnect.php"; //check for a page number. If not, set it to page 1 if (!(isset($_GET['pagenum']))){ $pagenum = 1; }else{ $pagenum = $_GET['pagenum']; } //query for record count to setup pagination $data = mysql_query("SELECT * FROM tblPhotos WHERE Type='$user' "); $rows = mysql_num_rows($data); //number of photos per page $page_rows = 16; //get the last page number $last = ceil($rows/$page_rows); //make sure the page number isn't below one, or more than last page num if ($pagenum < 1){ $pagenum = …

Member Avatar
Member Avatar
+0 forum 4

The End.