Can you you help me please,I have following code:
do
{
$sql='INSERT INTO rezerv (date,ime) VALUES ($_POST["date1"],$_POST["ime"])';
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Success!";
********in this place I need increment "date1" for 1 day********
*******format for date is year,month,day******************
}
while (($_POST["date1"]) != (($_POST["date2"])
thanks!
increment date
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: increment date
Please use PHP tage when posting PHP code. Thanks. This is how it should look. See comments at the bottom...
Have you looked at the mysql date() function? Or how about the PHP strtotime() function coupled with the PHP Date() funtion?
Code: Select all
<?php
do
{
$sql='INSERT INTO rezerv (date,ime) VALUES ($_POST["date1"],$_POST["ime"])';
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Success!";
********in this place I need increment "date1" for 1 day********
*******format for date is year,month,day******************
}
while (($_POST["date1"]) != (($_POST["date2"])
?>