OnClick Insert Radio Button value into Database using PDO in jQuery Ajax PHP
Hi, Friends in this tutorial I show you how to insert data into MySQL database table using PHP PDO (PHP Data Object). Using Radio button I am going to insert values in the database. PDO helps named parameters, which makes the instant statements easier to read and understand for maintenance. MySQL only helps interrogation point as placeholders in prepared statements. You can handle all errors with one simple try/catch statement, which is way more easy to read than the procedural MySQL way.
$query="INSERT INTO gender(gender) VALUES (:gender)";
echo"Data Inserted Successfully..!";
echo"Data Insertion Failed";
Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts. If you have any questions let me drop an email with the article name to the following email id: firstname.lastname@example.org