Ⅰ 表单添加功能(php)
$name = "王二";$age = 23;$conn = new mysqli("localhost", "root", "root","user");$sql = "INSERT INTO student VALUES (null,'".$name."',".$age.")";print_r($conn->query($sql));//输出结果:1
用mysqli或者PDO连接数据库,不要使用mysql,mysql已经被淘汰了