hi guyes...
i have 2 files, schedulemasternew.php and schedule_entry.php.
here is schedulemasternew.php
And, here is schedule_entry.php
PHP Code:
<?php
ob_start();
session_start();
include_once("conn.php");
$count=$_SESSION["daycount"];
if($_GET['action']=="new")
{
if(mysql_query("INSERT INTO schedule(plotno,year,month) VALUES('$_POST[plotno]','$_POST[year]','$_POST[month]')"))
{
$sid = mysql_insert_id();
$litres =$_POST["litres"];
$hours =$_POST["hours"];
$record = explode('~',$litres);
$record1=explode('~',$hours);
for($i=0;$$i<$count;$i++)
{
$ScheduleDetail = explode("^",$record[$i]);
$ScheduleDetails = explode("^",$record1[$i]);
$sql ="INSERT INTO scheduledetail(scheduleid,date,litres,hours) values($sid,$i,'$ScheduleDetail[0]','$ScheduleDetails[0]')";
mysql_query($sql);
}
header("Location:index.php?page=schedulemaster");
}
else {
echo "<br>Query not executed";
}
}
?>
I am creating an application where user selects plot no, year and month. Then according to selected year and month, the no. of days for the selected month are calculated.
and then on next page i.e. schedulemasternew.php, user will have to enter date, litres and hours for no. of times depending upon the month and year selected (i.e. 31 times for January, 28 times for February).
and in schedule_entry.php, there is logic to insert the records.
but, i'm facing problem here while inserting records.
first of all, i'm not sure that, the array is properly created for the records to be inserted.
because, when i execute, it shows
Fatal Error :Maximum execution time of 30 seconds exceeded in C:\wamp\www\agro\agro\schedule_entry.php on line 20
and, when i check database, only last entry is inserted in scheduledetail table.
can u please tell me, how should i solve this problem...???