On my website I have made a automatic invoice system. It will generate a invoice for a certain user from a certain month. You can select the user, month and year and then click generate.
But, In my MYSQL Database, I've stored the products the user ordered on date with a Unix Timestamp. now I want to load all the products from a certain month by checking if the Unix Timestamp matches. But it won't work.
My code:
require "connect.php";
$create_by=$_GET['user'];
$jaar=$_GET['jaar'];
$maand=$_GET['maand'];
$number = cal_days_in_month(CAL_GREGORIAN, $maand, $jaar);
$result = mysql_query("SELECT *
FROM `mrbs_entry`
WHERE start_time >= UNIX_TIMESTAMP(".$jaar."-".$maand."-01)
AND start_time <= UNIX_TIMESTAMP(".$jaar."-".$maand."-".$number.")
AND create_by = '".$create_by".'
ORDER BY `start_time`, `room_id`");
The date is given through the link, like user, maand, jaar.
maand is the month, and jaar is the year.
start_timea UNIX timestamp?