正在嘗試的代碼:如何使用php將單選按鈕的數據更新到mysql數據庫?
更新單選按鈕的邏輯怎麼樣?這個可以嗎 ??
if(isset($_POST['btnSubmit']))
{
$book_save = $_POST['book_title'];
$author_save = $_POST['author_name'];
$gender_save = $_POST['gender'];
mysql_query("UPDATE bookss SET book_title ='$book_save',author_name ='$author_save',gender='$gender_save' WHERE ID = '$id'")
or die(mysql_error());
我指2個鏈接在左右,但中號沒有與單選按鈕正常越來越.... 建議總是歡迎...
[**請不要在新代碼**中使用'mysql_ *'函數](http: //bit.ly/phpmsql)。他們不再被維護[並被正式棄用](https://wiki.php.net/rfc/mysql_deprecation)。看到[**紅框**](http://j.mp/Te9zIL)?學習[*準備的語句*](http://j.mp/T9hLWi),並使用[PDO](http://php.net/pdo)或[MySQLi](http://php.net/ mysqli) - [這篇文章](http://j.mp/QEx8IB)將幫助你決定哪個。 – Kermit