[thelist] sql query php layout
Anderson Cummins
acummins at rogers.com
Sun Nov 24 11:08:01 CST 2002
You can simply find the number of rows returned define a global variable (
results per page) and do the devision to find how many groupings you will
need. I've implemented this and it works rather well.
<?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);
$result = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";
?>You could also limit the start point and end point of queries so that you
onlyretrieve the necessary amount of rows:$qry = "select * from table1 limit
$start, $number_per_query";Thanks,Anderson----- Original Message -----
From: "Andrew Maynes" <andrew at humanbehaviour.co.uk>
To: <thelist at lists.evolt.org>
Sent: Sunday, November 24, 2002 10:23 AM
Subject: [thelist] sql query php layout
> Guys I maybe getting myself inot an unnecessary muddle here so a little
> clarification on this would be nice :)
>
> I want to pull records from MySQL and present the results in a neat two x3
> table. Sometime there will be more than 6 records so a little 'view
results
> 7-12' etc will occur. Can anyone point me in the right direction so that
I can
> achieve this please?
>
> It's the table thing that is getting my train of thought all over the
place.
> it's the rolling effect that is really producing high levels of head
scratching
>
> thank you
> Andrew
>
> --
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
More information about the thelist
mailing list