Jump to content

[SOLVED] Grab info based on month


timmah1

Recommended Posts

I'm trying to break down sales on a monthly basis.

I want to show information for each month.

 

So, right now I'm trying to grab everything from the database where the field 'purchase'(month) equals May (05)

The purchase field type is DATE

 

Here is what I have, and it is not working correctly

$month = "05";
$sql3 = "SELECT * FROM affiliates1 WHERE purchase = '".date("m", strtotime($month))."' AND affil_id = '$code'";

 

How can I accomplish this?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/156252-solved-grab-info-based-on-month/
Share on other sites

Archived

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

×
×
  • 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.