Ⅰ 表單添加功能(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已經被淘汰了