ok, I am totally new to php and come from an asp background.
I basically want to do an If > then > else > end if statement:
my page is:
<?php require_once('C onnections/carresa.php'); ?>
<?php
$DateTime = date("Y/n/j");
$IP = $_SERVER["REMOTE_ADD R"];
mysql_select_db ($database_carr esa, $carresa);
$query_rs = "SELECT count(Hit_DateT ime) as mycount FROM unique_ip WHERE
Hit_IP = '$IP' and hit_datetime = '#$DateTime#'";
$rs = mysql_query($qu ery_rs, $carresa) or die(mysql_error ());
$row_rs = mysql_fetch_ass oc($rs);
$totalRows_rs = mysql_num_rows( $rs);
print "<span class=white11>" . $query_rs . "<br>IP: " .
$_SERVER["REMOTE_ADD R"] . "<br>Date Time: " . $DateTime . "<br>Count: " .
$row_rs['mycount'] . "</span>"
//at this point I want to say IF row_rs['mycount']== 0 THEN PRINT WELCOME ON
THE PAGE
if ($row_rs['mycount']=='0'){
print "welcome";
}
?>
The page errors on line 17 which is the if line.
Any ideas ???
thanks
James Campbell
I basically want to do an If > then > else > end if statement:
my page is:
<?php require_once('C onnections/carresa.php'); ?>
<?php
$DateTime = date("Y/n/j");
$IP = $_SERVER["REMOTE_ADD R"];
mysql_select_db ($database_carr esa, $carresa);
$query_rs = "SELECT count(Hit_DateT ime) as mycount FROM unique_ip WHERE
Hit_IP = '$IP' and hit_datetime = '#$DateTime#'";
$rs = mysql_query($qu ery_rs, $carresa) or die(mysql_error ());
$row_rs = mysql_fetch_ass oc($rs);
$totalRows_rs = mysql_num_rows( $rs);
print "<span class=white11>" . $query_rs . "<br>IP: " .
$_SERVER["REMOTE_ADD R"] . "<br>Date Time: " . $DateTime . "<br>Count: " .
$row_rs['mycount'] . "</span>"
//at this point I want to say IF row_rs['mycount']== 0 THEN PRINT WELCOME ON
THE PAGE
if ($row_rs['mycount']=='0'){
print "welcome";
}
?>
The page errors on line 17 which is the if line.
Any ideas ???
thanks
James Campbell
Comment