barkermn01
07-10-2008, 08:52 AM
ok what i want is
check the databace for the dates if it returns the date then dont output it
but if it is not there output it
this is my code so far
if($_GET['days'] == '7'){
$con = mysql_connect('localhost', 'User', 'pass');
$db = mysql_select_db('web177-orders');
while($i != 20){
$sql = "SELECT * FROM `Orders` WHERE `date`='$todayI' AND `year`='$year' AND `month`='$month'";
$query = mysql_query($sql, $con);
$row = mysql_fetch_array($query);
if(!isset($row['date']))
{
echo 'Friday '.$todayI.'th '.$months[$month].' '.$year.';';
$todayI += 7;
if($todayI > $days[$month]){$todayI = $todayI - $days[$month]; $month++;}
if($month > 12){$year++; isLeap($year); $month = $month - 12;}
$i++;
}
}
mysql_close($con);
}
if i change if
"(!isset($row['date']))" to if"(isset($row))" it is always true coz $row is set to array so how would i do it
At the moment this part of the script is creating a time out error of 30 secodns even thought there is nothing in the database
check the databace for the dates if it returns the date then dont output it
but if it is not there output it
this is my code so far
if($_GET['days'] == '7'){
$con = mysql_connect('localhost', 'User', 'pass');
$db = mysql_select_db('web177-orders');
while($i != 20){
$sql = "SELECT * FROM `Orders` WHERE `date`='$todayI' AND `year`='$year' AND `month`='$month'";
$query = mysql_query($sql, $con);
$row = mysql_fetch_array($query);
if(!isset($row['date']))
{
echo 'Friday '.$todayI.'th '.$months[$month].' '.$year.';';
$todayI += 7;
if($todayI > $days[$month]){$todayI = $todayI - $days[$month]; $month++;}
if($month > 12){$year++; isLeap($year); $month = $month - 12;}
$i++;
}
}
mysql_close($con);
}
if i change if
"(!isset($row['date']))" to if"(isset($row))" it is always true coz $row is set to array so how would i do it
At the moment this part of the script is creating a time out error of 30 secodns even thought there is nothing in the database