dreamzking Posted June 13, 2011 Share Posted June 13, 2011 hi every1 Actually i have stuck into a problem i have an student information system having so many tables in database (mysql) in attendance system i m able to populate rows of students in particular class dynamically and having two radio boxes (present, absent) infront of each (row) student. now the problem is i dont know after marking whole attendance page. how to submit attendance of all students in attendance table at once. because it is cheap and time consuming to mark attendance of single student each time. NOTE: i m using dreamweaver mx 2004 plz suggest me query what shud i write in code to submit multiple rows in a table at once. regards. dreamz Quote Link to comment https://forums.phpfreaks.com/topic/239224-php-mysql-student-attendance-sheet/ Share on other sites More sharing options...
DarkKnight2011 Posted June 16, 2011 Share Posted June 16, 2011 Could you please provide a bit more information in order for us to be able to assist you better, when you post this attendance register are you then wanting to create a mysql statement to store all of the attendees of the class on that day? if so you should be able to do something like ... INSERT INTO attendance ( courseId, studentId, date, attended) VALUES (1, 1, 'Y'), (1, 2, 'N'), (1, 3, 'Y') You could build this string dynamically in your code, Hope this helps DK Quote Link to comment https://forums.phpfreaks.com/topic/239224-php-mysql-student-attendance-sheet/#findComment-1230440 Share on other sites More sharing options...
dreamzking Posted June 18, 2011 Author Share Posted June 18, 2011 Dear i m posting dreamweaver code here plz let me know what correction shud i make for code to post multiple records at once On thing more... the student (stu_id) list is also populated dynamically from the table using repeated region here is my code $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO attend (stu_id, prog_id, subj_id, att_date, status, leave, descr, time_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['stu_id'], "int"), GetSQLValueString($_POST['prog_id'], "int"), GetSQLValueString($_POST['subj_id'], "int"), GetSQLValueString($_POST['att_date'], "text"), GetSQLValueString($_POST['status'], "text"), GetSQLValueString($_POST['leave'], "int"), GetSQLValueString($_POST['descr'], "text"), GetSQLValueString($_POST['time_id'], "text")); mysql_select_db($database_BICSA, $BICSA); $Result1 = mysql_query($insertSQL, $BICSA) or die(mysql_error()); } Quote Link to comment https://forums.phpfreaks.com/topic/239224-php-mysql-student-attendance-sheet/#findComment-1231376 Share on other sites More sharing options...
DarkKnight2011 Posted June 18, 2011 Share Posted June 18, 2011 personally I am not very familiar with the way Dreamweaver does this but from the code you posted, I personally wouldnt use it, Coding this yourself would give you alot more control over how it works, if you modify that code and intend on using a 'repeated region' to insert multiple rows will result in multiple insert queries rather than one. I would personally recommend not to use dreamweaver, but if your going to I would advise reading up on it a little more, or maybe someone more familiar with dreamweaver could help. If you want to re-code this using PHP yourself you will need to read up more on PHP & MySql Best of luck Quote Link to comment https://forums.phpfreaks.com/topic/239224-php-mysql-student-attendance-sheet/#findComment-1231429 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.