我有数据库包含名为 demnads 表的表包含 11 个单元格第一个是 id 自动增加我想在 php 中使用这个 sql 命令添加数据:
<?php
$hostname_mystore = "localhost";
$database_mystore = "mystore";
$username_mystore = "root";
$password_mystore = "";
$mystore = mysql_pconnect($hostname_mystore, $username_mystore, $password_mystore) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_query("set character_set_server='utf8'");
mysql_query("set names 'utf8'");
if (mysqli_connect_errno())
{ echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql= "INSERT into demands ( itemname , case , cname , fatora , client , cdate , ctime , prices , cmobile , numbers) values('$item[$i]','$cases[$i]','$customer[$i]','$fatora[$i]','$client[$i]','$dates[$i]','$times[$i]','$price[$i]','$mobile[$i]','$numbers[$i]' )";
?>
但没有插入数据