Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

easy query, what's wrong with it?


Guest

Recommended Posts

tep_db_query("select customers_info_date_account_created, customers_info_date_of_last_logon, customers_info_id from customers_info where customers_info_date_of_last_logon = 'NULL' and to_days(now()) - to_days(customers_info_date_account_created) >= 120 order by customers_info_id asc limit 0,1");

 

trying to output the 1st record in which the customer either HAS NOT logged in or has REGISTERED more than 120 days ago, but it doesn't seem to be outputting anything.

Link to comment
Share on other sites

Try this: (the table needs to be defined in caps and with " . TABLE_NAME ." not sure if anything else is wrong)

tep_db_query("select customers_info_date_account_created, customers_info_date_of_last_logon, customers_info_id from" . TABLE_CUSTOMERS_INFO . " where customers_info_date_of_last_logon = 'NULL' and to_days(now()) - to_days(customers_info_date_account_created) >= 120 order by customers_info_id asc limit 0,1");

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...