Jump to content


Photo

Pagination w/ >1 table field echoed


  • Please log in to reply
1 reply to this topic

#1 sKunKbad

sKunKbad
  • Members
  • PipPipPip
  • Advanced Member
  • 1,832 posts
  • LocationTemecula, CA, USA

Posted 03 April 2006 - 04:11 AM

My pagination works, I have this:

if (!isset($_GET['page'])){
  $page = 1;
} ELSE {
  $page = $_GET['page'];
}
$max_results = 10;
$from = (($page * $max_results) - $max_results);
$sql = mysql_query("SELECT * FROM localdirectory LIMIT $from, $max_results");                                 
                                           
while($row = mysql_fetch_array($sql)){                                 
echo $row ['name']."<br/>";

which is all good, but it only outputs the name field of my database, I want to be able to output all of the other fields, like ['address'],['city'],['st'],['zip']. I've tried adding that in various ways, but can't get it to work.

I can't figure it out. Please help.

Thanks for your help!
Brian's Web Design - Temecula

Freedom is only available through death.

#2 khendar

khendar
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 03 April 2006 - 04:49 AM

while($row = mysql_fetch_array($sql))
{                                
echo $row ['name']."<br/>";
echo $row ['address']."<br/>";
echo $row ['city']."<br/>";
echo $row ['st']."<br/>";
echo $row ['zip']."<br/>";
}


Doesn't work ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users