Jump to content

SNidhi

New Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by SNidhi

  1.     <?php

    $Title=$_POST['title'];
    $Price=$_POST['price'];
    $Author=$_POST['author'];
    $con=mysqli_connect('localhost','root') or die("not connected");
    mysqli_select_db($con,'BRM_DB');
    $query="INSERT INTO book(title,Price,Author)values('$Title',$Price,'$Author')";
    $result=mysqli_query($con,$query);
    mysqli_close($con);
        ?>
    <!DOCTYPE html>
    <html>
    <head>
    <title>Insertion</title>
    </head>
    <body>
    <h1>Book Record Management</h1>
    <p>
    <?php
    if($result==1)
        {
        echo ("Record inserted");
        }
        else 
        { 
        echo ("insertion failed");
        }
        ?>
    </p>
    <a href="insertform.php">click here</a>
    </body>
    </html>

    why it gives "insertion failed" as a result?

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.