Jump to content

php mysql student attendance sheet


dreamzking

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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());

}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.