Click here to Skip to main content
15,064,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<?php
@ob_start();
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CECRI KARAIKUDI</title>
<?php
include('css.php');
?>
</head>
<body>
<div class="row" align="center"><a href="index.php"><img src="img/header.png" class="img img-responsive" alt="" align="center" /></div><div class="clear_fix"></div><div class="row header_bot"><div class="col-sm-8"></div><div class="col-sm-4 pull-right" align="right">
	<?php if(isset($_SESSION['username'])){ ?>
    	 <span class="header_bot_span"><a href="logout.php">Logout</a></span>
    <?php } else { ?>
        <span class="header_bot_span"><a href="admin.php">Admin</a></span>
        <span class="header_bot_span"><a href="student_login.php">Student</a></span>
    <?php } ?>
 </div>
</div>
<div class="clear_fix"></div>

<!-- Start Content -->
	<div class="clearfix"></div>
<div class="row strip">
	class="fa fa-exchange">  <a href="index.php"><span class="strip_font">Home</span></a> / <a class="active" href=""><span class="strip_font" style="color:#C00;">Add Daily Attendance</span></a>
</div>
<div class="clearfix"></div>


<div class="col-md-12">
<div class="col-md-3 left_side_menu">
	<?php
    error_reporting(0);
	 include('db.php');
     include('admin_menu.php');
	 if(isset($_SESSION['username'])){
	if(isset($_POST['submit'])){
		//print_r($_POST);die;
		$roll_no = $_POST['roll_no'];
		$name = $_POST['name'];
		$class = $_POST['class'];
		$date = $_POST['date'];
		$subject_name_and_subject_code = $_POST['subject_name_and_subject_code'];
		$subject_handle = $_POST['subject_handle_by'];
		$batch=$_POST['batch'];
		$semester=$_POST['semester'];
		$period=$_POST['period'];
        $present = $_POST['atten'];
        // echo "INSERT INTO daily_atten(id, roll, class, date, subject_name_and_subject_code, subject_handle_by, batch, semester, period1, present) VALUES ('$roll','$class','$date','$subject_name_and_subject_code','$subject_handle_by','$batch','$semester','$period','$present')");
        $sql = $db->query("INSERT INTO `daily_atten`(`id`, `roll_no`, `class`, `date`, `subject_name_and_subject_code`, `subject_handle_by`, `batch`, `semester`, `period`, `present`) VALUES ('','$roll_no','$class','$date','$subject_name_and_subject_code','$subject_handle_by','$batch','$semester','$period','$present')")or die(mysqli_error());
		if($sql){
			echo "<script>alert('Details Saved Successfully');</script>";
		}else{
			echo "<script>alert('Failed to Save the details. Please Check');</script>";	
		}
    }
    // die();
    ?>
</div>
<div class="col-md-9 col-sm-9 col-xs-12 content_border" style="margin-top:10px; padding:10px;">
<h3 style="font-weight:bold; text-transform:uppercase; padding-bottom:5px;"> Add Student Attendance (Daily)</h3>
<div class="row">
<div class="col-md-6 ol-sm-6 col-xs-12">
<table class="table table-bordered table-responsive">
<?php
	$query = $db->query("select * from class") or die(mysqli_error());
?>
<form method="post" action="" enctype="multipart/form-data">
<tr>
	<th>Student Roll No.</th>
    <td><input type="text" name="roll_no"  placeholder="roll_no"  class="form-control my_form" required="required" /></td>
</tr>
<tr>
	<th>Student Name</th>
    <td><input type="text" name="name"  placeholder="Student Name" class="form-control my_form" required=" required" /></td>
</tr>
<tr>
	<th>Class</th>
    <td><select name="class" class="form-control my_form">
	<?php
        while($row = mysqli_fetch_assoc($query)){ ?>
                <option value="<?php echo $row['class_name']; ?>"><?php echo $row['class_name']; ?></option>
    <?php } ?>
		</select>
    </td>
</tr>
<tr>
	<th>Date</th>
    <td><input type="date" name="date" class="form-control my_form" placeholder="mm/dd/yyyy" required /></td>
</tr>
<tr>
	<th>subject name and subject code</th>
    <td>
    	<select name="subject_name_and_subject_code" required="required" class="form-control my_form">
            <option value="">subject name and subject code</option>
            <option value="HS851-TECHNICAL ENGLISH:(4004)-(II-SEM)">HS851-TECHNICAL ENGLISH:(4004)-(II-SEM)</option>
            <option value="MA8251-ENGINEERING MATHEMATICS-II:(4004)-(II-SEM)">MA8251-ENGINEERING MATHEMATICS-II:(4004)-(II-SEM)</option>
            <option value="PH8254-PHYSICS OF MATERIALS:(3003)-(II-SEM)">PH8254-PHYSICS OF MATERIALS:(3003)-(II-SEM)</option>
            <option value="CY8292-CHEMISTRY FOR TECHNOLOGISTS:(3003)-(II-SEM)">CY8292-CHEMISTRY FOR TECHNOLOGISTS:(3003)-(II-SEM)</option>
            <option value="BE8251-BASIC ELECTRICAL AND ELECTRONICS ENGINEERING:(3003)-(II-SEM)">BE8251-BASIC ELECTRICAL AND ELECTRONICS ENGINEERING:(3003)-(II-SEM)</option>
            <option value="EL8201-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(II-SEM)">EL8201-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(II-SEM)</option>
            <option value="MA6459-NUMERICAL METHODS:(3104)-(IV-SEM)">MA6459-NUMERICAL METHODS:(3104)-(IV-SEM)</option>
<option value="CH6455-CHEMICAL ENGINEERING THERMODYNAMICS:(3104)-(IV-SEM)">CH6455-CHEMICAL ENGINEERING THERMODYNAMICS:(3104)-(IV-SEM)</option>
<option value="EL6401-CHEMICAL RECTION ENGINEERING:(3003)-(IV-SEM)">EL6401-CHEMICAL RECTION ENGINEERING:(3003)-(IV-SEM)</option>
<option value="CH6460-MATERIAL TECHNOLOGY:(3003)-(IV-SEM)">CH6460-MATERIAL TECHNOLOGY:(3003)-(IV-SEM)</option>
<option value="EL6402-HEAT TRANSFER AND ITS APPILCTION:(3003)-(IV-SEM)">EL6402-HEAT TRANSFER AND ITS APPILCTION:(3003)-(IV-SEM)</option>
<option value="EL6403-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(IV-SEM)">EL6403-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(IV-SEM)</option>
<option value="EL6601-ELECTROCHEMICAL MATERIALS SCIENCE:(3003)-(VI-SEM)">EL6601-ELECTROCHEMICAL MATERIALS SCIENCE:(3003)-(VI-SEM)</option>
<option value="CH6653-MASS TRANSFER-II:(3003)">CH6653-MASS TRANSFER-II:(3003)</option>
<option value="EL6602-INDUSTRIAL MATERIAL FINISHING:(3003)-(VI-SEM)">EL6602-INDUSTRIAL MATERIAL FINISHING:(3003)-(VI-SEM)</option>
<option value="EL6603-INSTRUMENTATION:(3003)-(VI-SEM)">EL6603-INSTRUMENTATION:(3003)-(VI-SEM)</option>
<option value="EL6604-ELECTROCHEMICAL PROCESS TECHNOLOGY:(3003)-(VI-SEM)">EL6604-ELECTROCHEMICAL PROCESS TECHNOLOGY:(3003)-(VI-SEM)</option>
<option value="EL6605-PROCESS DYNAMICS AND CONTROL:(3104)-(VI-SEM)">EL6605-PROCESS DYNAMICS AND CONTROL:(3104)-(VI-SEM)</option>
<option value="EL6801-ELECTROCHEMICAL ENERGY CONVERSION & STORAGE:(3003)-(VIII-SEM)">EL6801-ELECTROCHEMICAL ENERGY CONVERSION & STORAGE:(3003)-(VIII-SEM)</option>
<option value="EL6802 SURFACE SCIENCE:(3003)-(VIII-SEM)">EL6802 SURFACE SCIENCE:(3003)-(VIII-SEM)</option>
<option value="ELECTIVE-II EL6005 CATHODIC PROTECTION & ELECTROPHRETIC COATINGS-(VIII-SEM)">ELECTIVE-II EL6005 CATHODIC PROTECTION & ELECTROPHRETIC COATINGS-(VIII-SEM)</option>

            
        </select>
    </td>
</tr>
<tr>
<th>Subject_handle_by</th>
    <td>
    	<select name="subject_handle" required="required" class="form-control my_form">
        <?php
        while($row = mysqli_fetch_assoc($query)){ ?>
                <option value="<?php echo $row['subject_handle_by']; ?>"><?php echo $row['subject_handle_by']; ?></option>
    <?php } ?>
            <option value="">subject handle by</option>
            <option value="Mr.THOMAS ALEXANDER,M.A.M.Phil(TECHNICAL ENGLISH)">Mr.THOMAS ALEXANDER,M.A.M.Phil(TECHNICAL ENGLISH)</option>
            <option value="Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(ENGINEERING MATHS-II">Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(ENGINEERING MATHS-II</option>
            <option value="Mr.D.SHERWOOD,M.Sc,P.G.D.C.A(ENGINEERING MATHS-II)">Mr.D.SHERWOOD,M.Sc,P.G.D.C.A(ENGINEERING MATHS-II)</option>
            <option value="Dr.V.SARANYAN,M.Sc,Ph.D(PHYSICS OF MATERIALS)">Dr.V.SARANYAN,M.Sc,Ph.D(PHYSICS OF MATERIALS)</option>
<option value="Dr.M.RAMESH,M.Sc,Ph.D(PHYSICS OF MATERIALS">Dr.M.RAMESH,M.Sc,Ph.D(PHYSICS OF MATERIALS</option>
<option value="Dr.A.SUBBIAH,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)">Dr.A.SUBBIAH,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)</option>
<option value="Dr.M.KATHIRESAN,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)">Dr.M.KATHIRESAN,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)</option>
<option value="Mr.P.THIPPERUDRASAMY.PGD(emb.sys).M.Tech(BASIC ELECTRICAL AND ELECTRONICS ENGINEERING)">Mr.P.THIPPERUDRASAMY.PGD(emb.sys).M.Tech(BASIC ELECTRICAL AND ELECTRONICS ENGINEERING)</option>
<option value="Er.V.GOPALAKRISHAN,B.E(BASICS ELECTRICAL AND ELECTRONICS ENGINEERING)">Er.V.GOPALAKRISHAN,B.E(BASICS ELECTRICAL AND ELECTRONICS ENGINEERING)</option>
<option value="Dr.J.MATHIYARASU,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY)">Dr.J.MATHIYARASU,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY)</option>
<option value="Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY">Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY</option>
<option value="Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(NUMERICAL METHODS)">Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(NUMERICAL METHODS)</option>
<option value="Mr.D.SHERWOORD,M.Sc,P.G.D.C.A(NUMERICAL METHODS)">Mr.D.SHERWOORD,M.Sc,P.G.D.C.A(NUMERICAL METHODS)</option>
<option value="Dr.R.MALINI,M.Tech,Ph.D(CHEMICAL ENGINEERING THERMODYNAMICS)">Dr.R.MALINI,M.Tech,Ph.D(CHEMICAL ENGINEERING THERMODYNAMICS)</option>
<option value="Dr.V.RAVI BABU,M.Tech,Ph.D(CHEMICAL REACTION ENGINEERING)">Dr.V.RAVI BABU,M.Tech,Ph.D(CHEMICAL REACTION ENGINEERING)</option>
<option value="Dr.L.JHON BERCHMANS,M.Tech,Ph.D(MATERIALS TECHNOLOGY)">Dr.L.JHON BERCHMANS,M.Tech,Ph.D(MATERIALS TECHNOLOGY)</option>
<option value="Dr.M.SATHISH,M.Sc,Ph.D(MATERIALS TECHNOLOGY)">Dr.M.SATHISH,M.Sc,Ph.D(MATERIALS TECHNOLOGY)</option>
<option value="Dr.G.SREEDHAR,M.Tech,Ph.D(HEAT TRANSFER AND ITS APPLICATIONS)">Dr.G.SREEDHAR,M.Tech,Ph.D(HEAT TRANSFER AND ITS APPLICATIONS)</option>
<option value="Dr.J.MATHIYARASU,M.Sc,PH.D(PRINICIPLES OF ELECTROCHEMISTRY)">Dr.J.MATHIYARASU,M.Sc,PH.D(PRINICIPLES OF ELECTROCHEMISTRY)</option>
<option value="Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINICIPLES OF ELECTROCHEMISTRY)">Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINICIPLES OF ELECTROCHEMISTRY)</option>
<option value="Dr.B.SUBRAMANIAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">Dr.B.SUBRAMANIAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option>
<option value="Dr.N.LAKSHMINARASIMHAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">Dr.N.LAKSHMINARASIMHAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option>
<option value="Dr.KARTHIK,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">r.KARTHIK,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option>
<option value="Dr.V.MURUGAN,B.Phram,M.S,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option>
<option value="Dr.SUNDAR MAYAVAN,B.Tech,M.S.Ph.D(MASS TRANSFER)">Dr.SUNDAR MAYAVAN,B.Tech,M.S.Ph.D(MASS TRANSFER)</option>
<option value="Dr.R.SEKAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)">Dr.R.SEKAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)</option>
<option value="Dr.M.JAYAKUMAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)">Dr.M.JAYAKUMAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)</option>
<option value="Dr.N.RAJASHAKARANM.Sc,Ph.D(INDUSTRIAL METAL FINISHING)">Dr.N.RAJASHAKARANM.Sc,Ph.D(INDUSTRIAL METAL FINISHING)</option>
<option value="Dr.S.RADHAKRISHAN,M.Sc,Ph.D(INSTRUMENTATION)">Dr.S.RADHAKRISHAN,M.Sc,Ph.D(INSTRUMENTATION)</option>
<option value="Dr.G.SOZHAN,M.E,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.G.SOZHAN,M.E,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option>
<option value="Dr.T.VIJAYABHARATHI,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.T.VIJAYABHARATHI,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option>
<option value="Dr.V.SURIYANARAYANAN,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.V.SURIYANARAYANAN,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option>
<option value="Dr.S.VENGATESAN,M.Sc,M.Tech,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.S.VENGATESAN,M.Sc,M.Tech,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option>
<option value="Dr.R.MAYANDI,BTech,Ph.D(PROCESS DYNAMICS AND CONTROL)">Dr.R.MAYANDI,BTech,Ph.D(PROCESS DYNAMICS AND CONTROL)</option>
<option value="Dr.M.V.T.DHANAJEYAN,M.Sc,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)">Dr.M.V.T.DHANAJEYAN,M.Sc,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)</option>
<option value="Dr.M.RAJU,M.E,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)">Dr.M.RAJU,M.E,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)</option>
<option value="Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)</option>
<option value="Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)'>Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)</option>
<option value="Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)</option>
<option value="Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)</option>
<option value="Dr.S.MARUTHAMUTHU,M.Sc,M.Phil,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">Dr.S.MARUTHAMUTHU,M.Sc,M.Phil,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option>
<option value="DR.SUNDAR MAYAVAN,B.Tech,M.S,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">DR.SUNDAR MAYAVAN,B.Tech,M.S,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option>
<option value="Dr.S.P.MANOHARAN,M.Sc,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">Dr.S.P.MANOHARAN,M.Sc,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option>
<option value="Dr.S.SREEJAKUMARI,M.Sc,M.Tech,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">Dr.S.SREEJAKUMARI,M.Sc,M.Tech,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option>


        

        </select>
    </td>
</tr>

<tr>
<th>Batch</th>
    <td>
    	<select name="batch" required="required" class="form-control my_form">
            <option value="">batch</option>
            <option value="2016">2016</option>
            <option value="2017">2017</option>
            <option value="2018">2018</option>
            <option value="2019">2019</option>
            <option value="2020">2020</option>
        </select>
    </td>
</tr>
<tr>
	<th>semester</th>
    <td>
    	<select name="semester" required="required" class="form-control my_form">
            <option value="">semester</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
        </select>
    </td>
</tr>
<tr>
	<th>period</th>
    <td>
    	<select name="period" required="required" class="form-control my_form">
            <option value="">period</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
        </select>
    </td>
</tr>
<tr>
	<th>Present</th>
    <td>
    	<select name="atten" class="form-control my_form">
        	<option value="Yes">Yes</option>
            <option value="No">No</option>
        </select>
    </td>
</tr>
<tr>
	<td colspan=2><center>          <input type="submit" value="submit" name="submit" class="my_btn" /></center></td>
</tr>
</table>
	  </form>
    	</div>
    	<div class="col-md-6 ol-sm-6 col-xs-12"></div>
    </div>
   </div>
</div>


<!-- End Content -->

<?php
include('footer.php');
} else{		
	header('location:index.php?suc=suc');	
}
?>
</body>
</html>


What I have tried:

db.php
<?php
error_reporting();
$db = new mysqli('localhost', 'root', '', 'cecri karaikudi');
if($db->connect_errno){
	die('Sorry Database not connected !!!');
}
?>
Posted
Updated 10-Mar-20 22:52pm

Yet another repost of your previous questions. And despite repeated requests you still do not provide any information apart from dumping the same code. You need to spend some time on the following activities:
1. Learning PHP
2. Learning MySQL
3. Learning how to collect diagnostic information.
4. Learning how to ask questions.

Sorry for the lecture but you really need to start making an effort to do the basics for yourself. You will not learn programming by asking the same question again and again.
   
Comments
Maciej Los 11-Mar-20 16:49pm
   
Oh, yeah!
nehaperiyasamy 11-Mar-20 23:18pm
   
you are right sir but im not having enough time for these because i have to finish my work early on your point sir i can learn at any time but i have to finish my work on their given deadline sir, thanks for your lecture sir ,i will follow this in my rest of the period.thank you sir
Richard MacCutchan 12-Mar-20 4:25am
   
You cannot finish the work if you do not even understand the languages you are using to code. I have no idea who is giving you deadlines on this, but you need to speak to them, and explain that you need time to learn before you can proceed further.
nehaperiyasamy 12-Mar-20 4:31am
   
thankyou
Most probably, the blank id value in the query is causing trouble.
Assuming id is the identity column for the table, just omit it on insert, it will be auto-generated by MySQL engine:
PHP
$sql = $db->query("INSERT INTO `daily_atten` (`roll_no`, `class`, `date`, `subject_name_and_subject_code`, `subject_handle_by`, `batch`, `semester`, `period`, `present`) VALUES ('$roll_no', '$class', '$date', '$subject_name_and_subject_code', '$subject_handle_by', '$batch', '$semester', '$period', '$present')") or die(mysqli_error());
   
Comments
Maciej Los 11-Mar-20 16:29pm
   
Good one!
MySql documentation says that it's possible to pass zero or null ;)
MySQL :: MySQL 8.0 Reference Manual :: 3.6.9 Using AUTO_INCREMENT[^]
phil.o 11-Mar-20 16:40pm
   
I didn't know that. Zero or null. Thanks for the update!
Maciej Los 11-Mar-20 16:48pm
   
You're very welcome.

Cheers,
Maciej
Quote:
Im a code beginner I dont know much can any one please help fro clear the problem the value is not insert in database

You probably get an error message, that error message is here to help you to figure out what is the problem and where. Telling us that error message would help us to figure out what is going on.
PHP
$sql = $db->query("INSERT INTO `daily_atten`(`id`, `roll_no`, `class`, `date`, `subject_name_and_subject_code`, `subject_handle_by`, `batch`, `semester`, `period`, `present`) VALUES ('','$roll_no','$class','$date','$subject_name_and_subject_code','$subject_handle_by','$batch','$semester','$period','$present')")or die(mysqli_error());

Where have you been told that ` is the same as ' or was part of SQL syntax ?

A very nice tutorial site to learn SQL syntax: SQL Tutorial[^]
   
v3
Comments
nehaperiyasamy 11-Mar-20 0:30am
   
the given value does not exits
Patrice T 11-Mar-20 0:37am
   
Full error message please.
Use Improve question to update your question.
So that everyone can pay attention to this information.
phil.o 11-Mar-20 1:44am
   
Backtick ` is MySQL's identifier quote character.
MySQL - Schema Object Names
Patrice T 11-Mar-20 1:54am
   
oops didn't knew this 1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900