I create the array here
function check_visit_table()
{
$this->table = "ftd_visit_log";
$this->query = mysql_query("SELECT ip_address FROM $this->table");
while ($this->results = mysql_fetch_object($this->query))
{
global $ip;
$ip[] = $this->results -> ip_address;
}
}
then I check to see if my ip is allready logged here
function log_user_info()
{
require_once 'Processes/Classes/sql_queries.php';
$this->ip = $_SERVER['REMOTE_ADDR'];
$this->referer = $_SERVER['HTTP_REFERER'];
$this->when = date("U");
$query = new queries;
$query->check_visit_table();
$address = $this->ip;
if (in_array($address, $ip))
{
$update = new queries;
$update->update_time($this->ip, $this->when);
return;
}
else if (empty($ip_address))
{
$insert = new queries;
$insert->log_user($this->ip, $this->referer, $this->when);
}
else
{
$insert = new queries;
$insert->log_user($this->ip, $this-referer, $this->when);
}
}
}
It inserts just fine but skips the checking part and gives me this warning
Warning: in_array(): Wrong datatype for second argument in path/to/index.php on line 22
Wrong datatype?? I am storing IP's do I have to change them to strings? as the . are making them floating integers?
I can print_r the array and retrieve the results.
Thanks,
Josh