Question: Please, I have this code below, I need to add the input data to the SQL table by using (PDO) when click on submit, I
Please, I have this code below, I need to add the input data to the SQL table by using (PDO) when click on submit, I want to get a message "your data added successfully" and another button to show all saved data :
*** You have errors in your data ***
"; } print " Book Summary
"; print " Book Title :".preg_replace("/[^a-z0-9]/i","",$_GET['bookTitle'])."
"; if($_GET['price'] <= 0) { $priceError = "Price should be a positive number please, " . $price . ", is not valid."; $okay = FALSE; }else print " Price : ".filter_var( $_GET['price'], FILTER_SANITIZE_NUMBER_INT)."
"; print " Describtion :".preg_replace("/[^a-z0-9]/i","",$_GET['describtion'])."
"; print " Category : $category "; } ?>
use PDO SQL to save FORM data and show the tabel
so, I have to create SQL table "book title, description, price, category, then when the user input data in that html form that will save in sql tabel by using PDO connections php with SQL and message will appear (your data added successfully) and another button to print the SQL table.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
