Re: Alphabetical pagination (RESOLVED)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is what finally worked:

     <?php                                                        $letter = isset($_GET['letter']) ? $_GET['letter'] : "A";                                                        //alphabetical pagination links                                                        echo '<div align="center"><b>';                                                        foreach(range('A','Z') as $c){                                                          ($letter == $c)                                                            ? printf('%s&nbsp',$c)                                                            : printf('<a href="?letter=%s">%s</a>&nbsp;',$c,$c);                                                        }                                                        echo "</b></div><p>";                                                                                                                //Show all restaurants that start with $letter                                                        $sql = "SELECT * FROM restaurants WHERE name LIKE '{$letter}%'";                                                        $result = mysql_query($sql) or die(mysql_error());                                                        while($row = mysql_fetch_assoc($result)){                                                          printf('<div align="left" width="100"><b>%s</b><br>%s</br>%s</br></div><hr color=#000 width=200></hr>',$row['name'],$row['address'],$result['cviolations']);                                                        }                                                                                                                                                              ?>
Thanks again everyone!!


On 7/15/09 10:48 AM, "tedd" <tedd.sperling@xxxxxxxxx> wrote:

At 8:29 AM -0700 7/15/09, Miller, Terion wrote:
>
>Hi all thanks for all the suggestions, I really had no idea this was
>going to be so difficult..

I think you are making it more difficult than it has to be.

Please review what I said and try it out.

Cheers,

tedd



--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux