PHP interesse |
|
ok om het duidelijker te maken...
dit is de mysql table.
CREATE TABLE `reports` (
`rid` int(11) NOT NULL auto_increment,
`ipaddress` varchar(16) NOT NULL default '',
`type` enum('spam','virii','trojan','portscan','attack','intrusion','relay','other') NOT NULL default 'spam',
`subject` varchar(255) NOT NULL default '',
`description` varchar(255) NOT NULL default '',
`date` varchar(255) NOT NULL default '',
PRIMARY KEY (`rid`),
FULLTEXT KEY `subject` (`subject`),
FULLTEXT KEY `description` (`description`),
FULLTEXT KEY `ipaddress` (`ipaddress`)
) TYPE=MyISAM AUTO_INCREMENT=129 ;
CREATE TABLE `reports` ( `rid` int(11) NOT NULL auto_increment, `ipaddress` varchar(16) NOT NULL default '', `type` enum('spam','virii','trojan','portscan','attack','intrusion','relay','other') NOT NULL default 'spam', `subject` varchar(255) NOT NULL default '', `description` varchar(255) NOT NULL default '', ` date` varchar (255) NOT NULL default '', FULLTEXT KEY `subject` (`subject` ), FULLTEXT KEY `description` (`description` ), FULLTEXT KEY `ipaddress` (`ipaddress` )) TYPE=MyISAM AUTO_INCREMENT=129 ;
dit is het scriptje...
<?PHP
$spamquery = mysql_query("SELECT * FROM reports WHERE type = 'spam' ORDER BY ipaddress ASC");
$spamcount = mysql_num_rows($spamquery);
while($spam = mysql_fetch_array($spamquery)){
$sletjequery = mysql_query("SELECT * FROM sletjes WHERE ipaddress = '$spam[ipaddress]'");
$sletje = mysql_fetch_array($sletjequery);
?>
<td><?PHP echo "<a href='?page=admin/showip&ip=$spam[ipaddress]' title='$sletje[user]'>$spam[ipaddress]</a>"; ?></td> <?PHP
}
?>
<?PHP $spamquery = mysql_query("SELECT * FROM reports WHERE type = 'spam' ORDER BY ipaddress ASC"); $sletjequery = mysql_query("SELECT * FROM sletjes WHERE ipaddress = '$spam[ipaddress]'"); ?> <td> <?PHP echo "<a href='?page=admin/showip&ip=$spam[ipaddress]' title='$sletje[user]'>$spam[ipaddress]</a>"; ?></td> <?PHP} ?>
het laat gewoon een while loop doen om de data te weergeven, nu wil ik alleen kijken hoevaak elk ip voorkomt. |