hi guyes....
for the first time i came across the scenario like this.
can anyone tell me, how to insert multiple records in the same table under the same unique id dynamically...???
in my application, user selects year and month. then according to that month, user will have to insert specific no. of records (i.e. 31 records for January, 28 records for February).
so, i've to insert multiple entries for the same month in a same table, under same unique id.
i'm trying to do it in this way :
for ($i=1;$i<$maxday+1;$i++)
{ $sql = "INSERT INTO scheduledetail(scheduleid, date,litres,hours) VALUES($sid,$i,'$_REQUEST[litres]','$_REQUEST[hours]')";
mysql_query($sql);
$sql = substr( $sql, 0, strlen( $sql)-1 );
}
after executing this code, proper no. of entries are added in scheduledetail table, but only scheduleid and date fields are shown properly, other fields are shown as zero.
i'm wondering why it's happening..
can anyone please tell me how can i insert proper values for all the fields...???