I have a result management system for a school. I have three table in database.
- Table1 name mark
- Table2 name gpa
- Table3 name absent
Last 2 year i could insert data in one query but some days i cannot insert data properly using same code i used before. When i execute command sometimes no data insert into mark table, sometimes no data insert into gpa or absent table. what can i do ? here is my code below.
mysql_query("
insert into `mark`(`stid`,`roll`,`name`,`section`,`exam`,`year`,`ban1`,`ban2`,`eng1`,`eng2`,`mat`,`ssci`,`sci`,`tmark`)
values('$stid','$roll','$name','$section','$exam','$year','$ban1','$ban2','$eng1','$eng2','$mat','$ssci','$sci','$tmark')");
mysql_query("
insert into `stgpa`(`stid`,`exam`,`year`,`ban1gp`,`ban2gp`,`eng1gp`,`eng2gp`,`matgp`,`sscigp`,`scigp`,`tgpa`)
values('$stid','$exam','$year','$ban1grade','$ban2grade','$eng1grade','$eng2grade','$matgrade','$sscigrade','$scigrade','$avggpa')");
mysql_query("
insert into `absent`(`stid`,`exam`,`year`,`wday`,`abs`)
values('$stid','$exam','$year','$wday','$abs')");
echo"<code>Input successfully</code>";