dantana1776
asked on
Problem with a mysql query in running a cron
I am trying to run a cron job whereby the expired items on my site will be cleaned up once they've reached their expiration date. When I go to run the script that will execute this function I keep getting this message
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/school/public_html/c ron.php on line 1069
Here is the code
$admin_old_items="select * from admin_settings where set_id=20";
$admin_old_res=mysql_query ($admin_ol d_items);
$admin_old_row=mysql_fetch _array($ad min_old_re s);
$old="select * from placing_item_bid where (todays(now()) - todays(expire_date) ) >= ".$admin_old_row['set_valu e'];
$old_res=mysql_query($old) ;
while($old_row=mysql_fetch _array(old _res))
{
$del="delete from placing_item_bid where item_id=".$old_row[item_id ];
$del_sql=mysql_query($del) ;
$del="delete from placing_bid_item where item_id=".$old_row[item_id ];
$del_sql=mysql_query($del) ;
}
The line in question on the error message is
while($old_row=mysql_fetch _array(old _res))
Any help in resolving this would be great.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/school/public_html/c
Here is the code
$admin_old_items="select * from admin_settings where set_id=20";
$admin_old_res=mysql_query
$admin_old_row=mysql_fetch
$old="select * from placing_item_bid where (todays(now()) - todays(expire_date) ) >= ".$admin_old_row['set_valu
$old_res=mysql_query($old)
while($old_row=mysql_fetch
{
$del="delete from placing_item_bid where item_id=".$old_row[item_id
$del_sql=mysql_query($del)
$del="delete from placing_bid_item where item_id=".$old_row[item_id
$del_sql=mysql_query($del)
}
The line in question on the error message is
while($old_row=mysql_fetch
Any help in resolving this would be great.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Follow every mysql_query with the following:
echo mysql_error();
If there is no error, nothing will be echoed out, but if there is, you will see what the real error message is :))