时间:2021-07-01 10:21:17 帮助过:6人阅读
$mydb = new mysqli('localhost', 'username', 'password', 'databasename'); $sql = "INSERT INTO users (fname, lname, comments) VALUES ('$_POST[fname]', '$_POST[lname]', '$_POST[comments]')"; if ($mydb->query($sql) == TRUE) { echo "user entry saved successfully."; } else { echo "INSERT attempt failed" ; } $mydb->close();
希望本文所述对大家的php程序设计有所帮助。