♥yesudo Posted June 13, 2004 Share Posted June 13, 2004 I cannot locate it on google. thanx, Your online success is Paramount. Link to comment Share on other sites More sharing options...
OceanRanch Posted June 13, 2004 Share Posted June 13, 2004 to_days is a builtin mysql function not a php function. So you'll need to use it via a select clause. http://dev.mysql.com/doc/mysql/en/Date_and..._functions.html If I understand your question....... :-) Tom Link to comment Share on other sites More sharing options...
♥yesudo Posted June 13, 2004 Author Share Posted June 13, 2004 Thanx Tom.........again !! Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted June 13, 2004 Author Share Posted June 13, 2004 Tom, I am trying to include this as part of the where clause in a query: where (bcmod((TO_DAYS(NOW()) - TO_DAYS(membership_start_date)), 30)) = 0 but I get this error message: 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '((TO_DAYS(NOW()) - TO_DAYS(membership_start_date)), 30)) = 0' a select customers_id, membership_start_date from cancelled_membership where (bcmod((TO_DAYS(NOW()) - TO_DAYS(membership_start_date)), 30)) = 0 [TEP STOP] Any ideas ? Is it because I am trying to use bcmod in the query clause ? Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted June 13, 2004 Author Share Posted June 13, 2004 think I have it: $cancel_query_raw = "select customers_id, TO_DAYS(NOW()) - TO_DAYS(membership_start_date) as difference from " . TABLE_CANCELLED_MEMBERSHIP . ""; $cancel_query = tep_db_query($cancel_query_raw); while ($cancel = tep_db_fetch_array($cancel_query)) { if (bcmod($cancel['difference'], 30) == 0) Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted June 13, 2004 Author Share Posted June 13, 2004 No - now I have it: $cancel_query_raw = "select customers_id, TO_DAYS(NOW()) as now, TO_DAYS(membership_start_date) as start_date from " . TABLE_CANCELLED_MEMBERSHIP . ""; $cancel_query = tep_db_query($cancel_query_raw); while ($cancel = tep_db_fetch_array($cancel_query)) { $diffdate = $cancel['now'] - $cancel['start_date']; $checkit = bcmod($diffdate, 30); if ($checkit == 0) Your online success is Paramount. Link to comment Share on other sites More sharing options...
OceanRanch Posted June 13, 2004 Share Posted June 13, 2004 Emmett, You did GOOD work while I was painting the back of the house. :D Link to comment Share on other sites More sharing options...
♥yesudo Posted June 13, 2004 Author Share Posted June 13, 2004 Only with your help Tom. Hope it wasn't Pink. Your online success is Paramount. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.