Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <html>
- <?php
- $con=mysqli_connect("localhost","root","","dedatabase");
- if (mysqli_connect_errno())
- {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
- $pi = $_POST['proid'];
- $pn = $_POST['pname'];
- $d = $_POST['desc'];
- $p = $_POST['price'];
- $s = $_POST['stock'];
- $sql= "INSERT INTO product
- VALUES ('$pi','$pn','$d','$p','$s')";
- if(mysqli_query($con, $sql)){
- echo "Records inserted successfully.";
- } else{
- echo "ERROR: Could not able to execute $sql. " . mysqli_error($con);
- }
- mysqli_close($con);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement