PHP-Code:
if(if(...
investiere die zeit, die du zum posten brauchst, lieber in die lektüre des manuals o.ä. grundlagen.
<php
$host = "localhost";
$user = "user";
$pass = "123456";
$database = "database";
mysql_connect($host,$user,$pass);
mysql_select_db($database)
$ip = $REMOTE_ADDR;
$datum = date("Y m d");
$zeit = date("h:i:s A");
$sql_select = "SELECT * FROM `ipdatetime`";
$result_select = mysql_query($query_0) or die(mysql_error());
if(!mysql_num_rows($result_select)) {
$insert = "INSERT INTO `ipdatetime` (`ip`,`date`,`time`) VALUES("$ip","$datum","$zeit")";
$result_insert = mysql_query($insert) or die(mysql_error());
}
if(!mysql_num_rows($result_select) == true)
echo 'true';
else
echo 'nicht true';
?>
mysql_connect($host,$user,$pass);
mysql_select_db($database)
$ip = $REMOTE_ADDR;
$datum = date("Y m d");
$zeit = date("h:i:s A");
$sql_select = "SELECT * FROM ipdatetime";
$result_select = mysql_query($query_0) or die(mysql_error());
if(!mysql_num_rows($result_select)) {
$insert = "INSERT INTO ipdatetime (ip,date,time) VALUES('".$ip."','".$datum."','".$zeit."')";
$result_insert = mysql_query($insert) or die(mysql_error());
}
error_reporting(E_ALL);
Kommentar