Jump to content

mySQL help...


subhomoy

Recommended Posts

Suppose i have created a database and i have created a table by using the code below

  Quote
CREATE TABLE `track` (

`id` int(6) NOT NULL auto_increment,

`tm` varchar(15) NOT NULL default '',

`ref` varchar(250) NOT NULL default '',

`agent` varchar(250) NOT NULL default '',

`ip` varchar(20) NOT NULL default '',

`ip_value` int(11) NOT NULL default '0',

`domain` varchar(20) NOT NULL default '',

`tracking_page_name` varchar(10) NOT NULL default '',

UNIQUE KEY `id` (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

 

and the script  to store the details in that database is below

  Quote
$tm=time();

$ref=@$HTTP_REFERER;

$agent=@$HTTP_USER_AGENT;

$ip=@$REMOTE_ADDR;

$strSQL = "INSERT INTO track(tm, ref, agent, ip, tracking_page_name) VALUES ('$tm','$ref','$agent','$ip','$tracking_page_name')";

$test=mysql_query($strSQL);

 

i want to know that if i have 10 ip in that database out of which there are 3 ip's are same. is there any way in which it will show there are only 7 ip ( as 3 ip's are same)

 

Any help would be appreciated...

if possible can you provide the code.....

thanks in advance...

Link to comment
https://forums.phpfreaks.com/topic/255118-mysql-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.