noTrack = true; // Disable logagent tracking // ******************************************************************* $S = new SimpleSiteClass($_site); $T = new SimpledbTables($S); // Pass some info to getPageTopBottom method $S->title = "Example 5"; // Goes in the $S->banner = "

Example Five

"; // becomes the
section $S->defaultCss = "../css/style.css"; // Add some local css to but a border and padding on the table $S->css = <<isBot($S->agent)) ? "Yes" : "No"; [$top, $footer] = $S->getPageTopBottom(); $sql = "create table if not exists $S->masterdb.test (`name` varchar(20), `date` datetime, `lasttime` datetime)"; $S->query($sql); for($i=0; $i<5; $i++) { $name = "A-name$i"; $S->query("insert into $S->masterdb.test (name, date, lasttime) values('$name', now(), now())"); } $sql = "select * from $S->masterdb.test order by lasttime"; // For more information on dbTables you can look at the source or the documentation in the docs // directory on on line at https://bartonlp.github.io/site-class/ $T = new SimpledbTables($S); $tbl = $T->maketable($sql, ['attr'=>['id'=>'table1', 'border'=>'1']])[0]; $S->query("drop table $S->masterdb.test"); $S->query("select count from $S->masterdb.logagent where site='Examples' and ip='$S->ip' and agent='$S->agent' order by lasttime"); $count = $S->fetchrow('num')[0]; echo <<

Are you a BOTS? $bot.

The value of logarent count=$count

Create a html table from the logagent database table

$sql

The test table follows:

$tbl

Example1
Example2
Example3
Example4
Example5
Example6
PHPINFO
$footer EOF;