-2

I´m trying to send a automatic sms, 24 hours before our resident have a appointment.

But I have a problem figuring out how I get the date and time in the datetime row in my mysql. I could make a input, but my co workers are IT stupid, and would mess up the right date/time.

I would love a select, one for the month, day and time, but is that possible, to get multi values into one row ?

user3272367
  • 69
  • 1
  • 7
  • ^... And can't you just make one input for the datetime? – Spoody Apr 04 '18 at 18:41
  • You should show some of your work, what SQL queries are you trying? what framework is your PHP-app based on? etc. – versvs Apr 04 '18 at 18:42
  • nothing, I did forgus on the send sms. but I wanted to gét some good ide´s so I didn't have to waste my time. – user3272367 Apr 04 '18 at 18:43
  • *"I would love a select, one for the month, day and time, but is that possible"* - Why are you complicating things? Just check with an INTERVAL. – Funk Forty Niner Apr 04 '18 at 18:53
  • Just check with an INTERVAL, could you explaime, or maybe show a link ? – user3272367 Apr 04 '18 at 18:56
  • 1
    Your question is not clear, problem statement is not clearly defined. It will help if you show some code of what you have tried, the result you got and your expected result. Also not nice calling people IT stupid. – Jacob Apr 04 '18 at 18:58
  • @user3272367 See what I posted below, it was too long for a comment. – Funk Forty Niner Apr 04 '18 at 19:03
  • Usually a row in a table has multiple columns. So what you are asking for ("get multi values into one row") is all what tables are about. – Paul Spiegel Apr 04 '18 at 19:05
  • I don't see any `php`, `html`, `mysql`, or `jscript`. Are you referring to `JavaScript` or Microsoft's [JScript](https://en.wikipedia.org/wiki/JScript)? What have you tried? – adprocas Apr 04 '18 at 19:13
  • 1
    [Do more research](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) then **post what you've tried** with a **clear explanation of what isn't** working and provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). Read [How to Ask a good question](https://stackoverflow.com/help/how-to-ask). Be sure to [take the tour](https://stackoverflow.com/tour) and read [this](https://meta.stackoverflow.com/questions/347937/im-new-to-stack-overflow-what-are-some-things-i-should-do-and-what-things-wil). – adprocas Apr 04 '18 at 19:14
  • (FYI): I've left the question. Seems the OP probably did also. – Funk Forty Niner Apr 04 '18 at 19:19

1 Answers1

2

In regards to:

I´m trying to send a automatic sms, 24 hours before our resident have a appointment.

You have a few options to do this, if not more.

  • SELECT (col_x, col_y, col_z) FROM TABLE WHERE DATE > DATE_SUB(NOW(), INTERVAL 24 HOUR)
  • SELECT (col_x, col_y, col_z) FROM TABLE WHERE DATE >= NOW() - INTERVAL 1 DAY

If that doesn't satisfy your query which you didn't leave us much information about, then you will need to do the reverse (operators) for the above.

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141