1 Replies - 153 Views - Last Post: 06 February 2012 - 12:33 PM Rate Topic: -----

Topic Sponsor:

#1 decongh  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 39
  • Joined: 31-December 11

Print all records present in table mysql db

Posted 06 February 2012 - 11:44 AM

Am having a hard time printing all record percent in my db

my sql statement
$query="SELECT *, duedate,(TO_DAYS(duedate) - TO_DAYS(CurDate())) as difference FROM vehicle_info ORDER by svreg";
				
				//$query="SELECT * FROM vehicle_info WHERE id='$id' ORDER by vreg";
				$pager = new PS_Pagination($conn,$query,10,10);
				$accra = $pager->paginate();
				while($row = mysql_fetch_assoc($accra)) 
				{
					$id = $row['id'];
					$ymodel = $row['ymodel'];
					$make = $row['make'];
					$chassis = $row['chassis'];
					$color = $row['color'];
					$driver = $row['driver'];
					$svreg = $row['svreg'];
					$engine = $row['engine'];
					$trans = $row['trans'];
					$tsize = $row['tsize'];
					$fleet_no = $row['fleet_no'];
					$axles = $row['axles'];
					$company = $row['company'];
					$account = $row['account'];
					$premium = $row['premium'];
					$duedate = $row['duedate'];
					$dvla_date = $row['dvla_date'];
					$intax_date = $row['intax_date'];
					$cur_date = $row['cur_date'];
					$numDays = $row['difference'];
				
						  		} 

I want to select all archives in
vehicle_info
and print all at once.

Is This A Good Question/Topic? 0
  • +

Replies To: Print all records present in table mysql db

#2 Jstall  Icon User is offline

  • Lurker
  • member icon

Reputation: 380
  • View blog
  • Posts: 961
  • Joined: 08-March 09

Re: Print all records present in table mysql db

Posted 06 February 2012 - 12:33 PM

Hi,

Well it looks like you are using a paginator of some kind there.
$pager = new PS_Pagination($conn,$query,10,10);
$accra = $pager->paginate();



Without knowing the specifics of how your paginator works I can guess that you are only getting records for the current page there. If you want every record just run the query without using the paginator.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1