0

im having problem with my this,
what i want to happen is when i submit, i want to save those records from 2 diffrent
table's from my db, but it wont save? have you seen any problem with my code?
thanks!

<?php
	include("connect.php");
	if(isset($_POST['submit']))
	{
	mysql_query("insert into tblgrading set idno='$_POST[id]',
	lastname='$_POST[lname]',
	firstname='$_POST[fname]',
	grading='$_POST[grading]',
	year='$_POST[year]',
	english='$_POST[eng]',
	math='$_POST[mat]',
	filipino='$_POST[fil]',
	makabayan='$_POST[mak]',
	skmsep='$_POST[msep]',
	chareduc='$_POST[chared]',
	genave='$_POST[ave]'");
	mysql_query("insert into attendance set idno'$_POST[id]',
	lastname='$_POST[lname]',
	firstname='$_POST[fname]',
	month='$_POST[month]',
	dpresent='$_POST[dpresent]',
	dabsent='$_POST[dabsent]'");
	}
	?>
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by phorce
0

Could you please tell us what the errors are? Also, noticed a few things:

1) Your "idno" should be set as AUTO_INCREMENT inside your database.
2) You should define your variables better, or, at least define them and run some checks on them before they get entered into the database.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.