I have a code that will log the ip of the user and display it, however it's not logging it. It doesn't say there's anything wrong with the code, and doesn't give me any errors, just when I type select * from ips; it says empty set. Here's the code:
PHP Code:
<?php
$ip 
$_SERVER['REMOTE_ADDR'];
$sql "INSERT INTO ips SET
       ip='
$ip',
       view_date='CURDATE()',
       view_time='CURTIME()'"
;
if (
$sql) {
  echo(
'IP Logged: ' $ip '');
} else {
  die(
'Error logging your ip:' $ip '');
}
?>
and here's my sql code (MySQL):
Code:
CREATE TABLE ips (
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
ip VARCHAR(15) NOT NULL,
view_date DATE NOT NULL,
view_time TIME NOT NULL
);
Query OK, 0 rows affected (0.01 sec)
I don't see anything wrong with my syntax or sql, any of you see anything wrong?