in the mysql table more then ten date column records there. i want select only last insert date record ,next i want selected date add 7 days in the date to store db again person want insert again select the last record then add 7 days selected last date ........ help me...
below the my code
<?php
$ques=$_REQUEST['ques'];
$host="localhost";
$user="";
$pass="";
$dbid="cdsemplo_poll";
$link=mysql_connect($host,$user,$pass);
mysql_select_db($dbid) or die("not connect");
$date=mysql_query("select date from poll1");
if(isset($_REQUEST['insert']))
{
// below the 2 line only add current date so i want insert the last date get the date from db to add 7 days next if person want to insert the another data same thing come to again
$tomorrow = mktime(0,0,0,date("m"),date("d")+7,date("Y"));
$d=date("Y/m/d", $tomorrow);
mysql_query("insert into poll1(question,date) values('$ques?','$newDate')");
}
mysql_close($link);
?>