PHP interesse |
|
Heb 2 rijen met dezelde dag 1 met 100 hits en 1 met 2 hits, maar hij laat 100 hits zien:S
<?
$stat3_query = mysql_query("SELECT hits,SUM(hits) FROM stats WHERE day='".date('d')."' AND month='".date('m')."' AND year='".date('y')."' GROUP BY day");
$stat3 = mysql_fetch_assoc($stat3_query);
echo $stat3['hits'];
?>
<? $stat3_query = mysql_query("SELECT hits,SUM(hits) FROM stats WHERE day='".date('d')."' AND month='".date('m')."' AND year='".date('y')."' GROUP BY day"); ?>
Table:
CREATE TABLE `stats` (
`id` int(5) NOT NULL auto_increment,
`hits` int(20) NOT NULL default '1',
`time` int(5) NOT NULL default '0',
`page` varchar(250) NOT NULL default 'Onbekend',
`browser` varchar(250) NOT NULL default 'Onbekend',
`os` varchar(250) NOT NULL default 'Onbekend',
`ip` varchar(15) NOT NULL default '',
`provider` varchar(250) NOT NULL default 'Onbekend',
`land` varchar(250) NOT NULL default '',
`day` char(2) NOT NULL default '',
`month` char(2) NOT NULL default '',
`year` char(2) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
CREATE TABLE `stats` ( `id` int(5) NOT NULL auto_increment, `hits` int(20) NOT NULL default '1', ` time` int (5) NOT NULL default '0', `page` varchar(250) NOT NULL default 'Onbekend', `browser` varchar(250) NOT NULL default 'Onbekend', `os` varchar(250) NOT NULL default 'Onbekend', `ip` varchar(15) NOT NULL default '', `provider` varchar(250) NOT NULL default 'Onbekend', `land` varchar(250) NOT NULL default '', `day` char(2) NOT NULL default '', `month` char(2) NOT NULL default '', `year` char(2) NOT NULL default '', ) TYPE=MyISAM;
|