Jump to content

Archived

This topic is now archived and is closed to further replies.

sKunKbad

Pagination w/ >1 table field echoed

Recommended Posts

My pagination works, I have this:

[code]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/>";[/code]

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!

Share this post


Link to post
Share on other sites
[code]
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/>";
}

[/code]

Doesn't work ?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.