Jump to content

Recommended Posts

Trying to do a mysql query via php.  Here's the statement...

 

$month = date(n);
$day = date(j);
$year = date(Y);

$sql = "SELECT * FROM pec_mssgs WHERE length(text)>0 AND y=$year AND m=$month AND d>=$day";

 

Here's the problem: The table I'm searching has a separate field for day, month, and year, so the only way I could think of to get the values for each and match it to today's date, would be by the way I have it set above.  Is there an easier way to do this?  Currently this thows errors about not being able to jump to different rows.

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.