1

I have a result management system for a school. I have three table in database.

  1. Table1 name mark
  2. Table2 name gpa
  3. 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>";
j.kaspar
  • 751
  • 1
  • 11
  • 29
  • I guess, the code has been modified or anything changed. Do some testing and try again. – AT-2017 Nov 20 '16 at 09:38
  • it is duplicate question > [click here for answer](http://stackoverflow.com/questions/30466422/insert-data-into-multiple-tables-using-one-form) – Man Nov 20 '16 at 09:52
  • Did you server admin maybe update your php version to 7 so that `mysql_query` is finally not supported anymore? To see what is going on, you should probably [enable error reporting](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php) – Solarflare Nov 20 '16 at 16:29
  • my server PHP Version 5.6.23. Please help me what can i do now because this is a big budget project and if i fail to solve it would not get my salary. Please tell me the code how to insert 3 table in one query? – Khondoker Muij uddin Nov 20 '16 at 18:44

0 Answers0