Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Modification...

Status
Not open for further replies.

i3iz

Technical User
Jan 3, 2005
30
US
We are in California, our servers are in FL 3 hour time difference. We want to launch our e-newsletter at 12 noon on thursday our time or 9am Eastern.

here is my code, my math seems to be off...

SELECT * FROM tide WHERE year = YEAR(CURDATE()) and col_num = 2 and week = week(DATE_ADD(CURDATE(),INTERVAL 57 hour)) ORDER BY priority ASC

 
isn't this a mysql issue? wouldn't you be better of posting in the mysql forum not the php forum?
 
date_add() is a php command, i believe. dont php and mysql work hand in hand?

i am not sure, i think i have less than 10 posts total, so please feel free to move this thread if you are a mod.

--i3iz
Technical Newbie
 
not a moderator, just interested in you getting the quickest advice.

definitively you can find a solution in php to your query, but you seem to be asking for a mysql solution.

if you are looking for a php soln, vary the dates first in php and then build the mysql query with the varied dates,

easier to debug that way.
 
my solution was to change the CURDATE() to NOW() as the CURDATE didnt include time, then i used HRS instead of fractions of days. It works great now. Thanks for your help jpad.

So a mysql syntax, even in a php document, should be posted in the mysql forum.

Where do you draw the line on what goes where? There seems to be a huge gray area of overlap. It would seem if i was adding $variable1 = Now() that would be php, but if i went one to say SELECT * WHERE NOW() = ????
that is mysql.... i am confused...

--i3iz
Technical Newbie
 
i guess the final arbiter is whether anyone can answer your question in the forum to which you post!
 
Generally speaking, if the question is about PHP syntax, post it here.

If the question is about the finer points of your database query, post it in the appropriate database's forum.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top