Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8234509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:30:15+00:00 2026-06-07T18:30:15+00:00

Sorry, I should have put more information in the question I am trying to

  • 0

Sorry, I should have put more information in the question

I am trying to figure out how to create a if statement that looks at a mysql field
for example: if date (“D”) = mysqlDateField

I have a small site that users put reminders into a forum to be sent to a specified email address on days they setup.

The days are stored in a mysql database in mon, tue, wed, etc. format.

The users can select multiple days so I have a field for each day (not sure if that is the best way to do it or not)

so I have a sendmail script that runs and sends out the emails with the reminders the users specified.

I want the if statement to check the current day against the day in the database

I am using the date (“D”) format currently since it matched what wa stored in the database

After looking around the different forums and w3schools I came up with this below but it is not working, I am new to php and mysql and not exactly sure how to get it working the way I want

$result = mysql_query("SELECT * FROM users")or die(mysql_error());
$d = date ("D");

if (mysql_num_rows($result)==$d)

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:30:17+00:00Added an answer on June 7, 2026 at 6:30 pm

    Some little note before the code sample:

    • creating a date to compare with D is bad, use some more useful
      format like ‘Ymd’;
    • the date you’re going to compare must be in the same format
      (you should not compare a ymd with a ymdhis date) becouse else they
      will give you inconsistent result. Convert or format the date
      before using them.
    • you are receiving a lot of result via wildcard query on tables,
      you should avoid when possible a SELECT *

      foreach($result as $row){    
          if(strtotime($row['field_with_date']) == strtotime($d)){ } }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I probably should have just put all this in one question, sorry for that
Sorry for what should be a simple solution. I am trying to 'Disable' a
UPDATE: sorry my IE 9 was'nt configured well: it should've been set so that
i have 8 movie Clips that i stored in an array. i put the
I have a FileStream that consists of several files put into one file, and
Several security experts have said in the past that the login page should be
First of all I'm sorry for the question's title, but I've spent hours trying
Sorry about the question title, but I couldn't find a more appropriate way to
Sorry about the really ambiguous question, I really have no idea how to word
I have one more question(first one is here: html, css with center div problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.