我有一个int(11)
的自动增量字段,在插入运行时值时它接受字符并成功运行查询但它没有插入表中。我该怎么办?
$res=mysqli_connect($target_address,$target_id,$target_password,$db_name);
if($res)
{
$conn2 = new PDO("mysql:host=$target_address;dbname=$db_name", $username, $target_password);
$q2="INSERT INTO $name ($value_2) VALUES ($value21)";
echo $q2;
$q3=$conn2->query($q2);
$sth = $conn2->prepare($q2);
$sth->execute();
$arr = $sth->errorInfo();
$arr1=$arr[2];
if($q3)
{
echo "<script type='text/javascript'>alert('Inserted successfully...');</script>";
}
else
{
echo '<script type="text/javascript">alert("' .$arr1. '")</script>';
}
}
else
{
echo "Connection failed";
}
请帮帮我。