且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在mysql数据库中插入查询?

更新时间:2023-01-12 14:18:08

tot = total + 1;


s =


_POST [' a'];
require(' connect.php');
全球


<?php
$tot="total+1";
$s=$_POST['a'];
require('connect.php');
global $pdo;
foreach($s as $value)
{
$stmt=$pdo->prepare("INSERT INTO atten (total) VALUES(:a) where roll=?");
$stmt->bindParam(':a',$tot);
$stmt->bindParam(1,$value);
$stmt->execute();
}
if($stmt==null)
{	
die("error".print_r($stmt->errorinfo()));
}
else
{
print_r($stmt);
echo"your attendence sucessfully update";
}
$pdo=null; 
?>

please help to insert data into database

tot="total+1";


s=


_POST['a']; require('connect.php'); global