Attendance system in php

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
developerahusain
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Sat May 31, 2014 10:59 pm

<?
function insert_data($num) { //////////////function 6
if($num>0){
$ins=0;
$str="";
while($ins<$num){
$ins=$ins+1;

if ($_POST ['roll_no'.$ins])
{

if(mysql_query("insert into table(roll_no) values ('"
.$_POST ['roll_no'.$ins]."')") or die("the eror ".mysql_error()));

}
}
}
}

if ($_POST ['b_submit'])
{
echo insert_data ("100");
} ?>
<form name="asdf" method="post">
<? $quer2=mysql_query("select * from table");
while($resul2=mysql_fetch_array($quer2))
{
$f++;
?>

<tr><td><input type="checkbox" value="<?=$resul2 ['roll_no'] ?>" name="roll_no<?=$f ?>" ></td></tr><?
}
?>
<tr><td><input type="submit" class="style_form" name="b_submit" value="Submit'></td></tr>
</form>

This will do as per your requirements.Any problem do revert.Do confirm if worked properly

Developerahusain

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests