php tutorials in hindi / urdu – 47 – Insert php form data in mysql tables




For all my tutorials go to: http://websofttutorials.com/ For any question go to: http://forum.websofttutorials.com/ In this tutorial I will teach you how to insert php form …

Original source


35 responses to “php tutorials in hindi / urdu – 47 – Insert php form data in mysql tables”

  1. <html>
    <head>
    </head>
    <body>
    <?php
    include_once('connection.php');
    if(isset($_POST['submit']))
    {
    $name=$_POST['name'];
    $email=$_POST['Email'];
    $add=$_POST['address'];
    $adm=$_POST['admission_date'];
    if($sql ="INSERT INTO muhammad(name, email,address,admission_date)
    VALUES ('$name','$email','$add','$adm')")
    {
    echo "submitted";
    }

    }
    ?>
    <form action="" method="POST">

    Name<br><input type= "text" name="name"/><br><br>
    Email<br><input type="text" name="Email"/><br><br>
    address<br><input type="text" name="address"/><br><br>
    admission_date<br><input type="text" name="admission_date"/><br><br>
    <br><input type="submit" name="submit"/>

    </form>
    </body>
    </html?

    ?>
    sir this is my code data is storing but not showing when i browse it sir plz tell me my mistake

  2. sir submit button par click kar ke ye error aa raha hai.

    Fatal error: Uncaught Error: Call to undefined function
    mysql_query() in C:xampphtdocsyyyyyy.php:7 Stack trace: #0 {main} thrown in C:xampphtdocsyyyyyy.php on line 7

    Line number 7: mysql_query("insert into paytm
    (name,email)VALUES('$name','$email')");

  3. Dear sir,
    first of all thank you so much for uploaded video on youtube.
    i made connection in database and created table also .but problem is when i upload my file in ftp error is showing "please chack the username or password"
    <?php

    $host = 'localhost';
    $username ='root';
    $password ='';
    $dbname ='student';
    mysql_connect($host, $username, $password) or die('Please chack username or password');
    mysql_select_db($dbname) or die('not connect to database');

  4. <?php
    include_once('connections.php');
    if(isset($_POST['submit']))
    {
    $name= $_POST['name'];
    $email=$_POST['email'];
    $add=$_POST['address'];
    $adm= $_POST['admission'];
    if(mysql_query("insert into students_records(name,,email,address,joinig_date) VALUE ('$name','$email','$add','$adm')"))
    {
    echo "submitted";
    }
    else
    {
    echo "not submitted";
    }
    }

    ?>
    <html>
    <head>
    <title>
    </title>
    </head
    >
    <body>

    <form action="" method="post">
    <p>Name: <br /><input type="text" name="name" id="" /></p>
    <p>Email:<br /><input type="text" name="email" id=""/></p>
    <p>Address:<br /><input type ="text" name="address" id=""/></p>
    <p>Admission Date :<br/><input type="date" name="admission" id="" /></p>
    <p><input type="submit" name="submit" value="submit"/></p>
    </form>

    </body>
    </html>
    here is my code its all the same as above instead table name but it is not inserting values in table displaying this message
    Showing rows 0 – 0 (1 total, Query took 0.0006 sec)
    please help me thank u

  5. hello sir thank you very much for your tutorials…!!!
    jab hum submit button press karte hai to submitted show nahi karta ye message show karta hai
    Fatal error: Call to undefined function mysql_query() in C:xampphtdocsphpworksindex.php on line 9

    <?php
    include_once("connection.php");
    if(isset($_POST["submit"]))
    {
    $name = $_POST['name'];
    $email = $_POST['email'];
    $add = $_POST['address'];
    $adm = $_POST['admission'];
    if(mysql_query("insert into students_record (name,email,address,joining_date) values ('$name','$email','$add','$adm')"));
    {
    echo "Submited";
    }
    }
    ?>

    plz help me..!!!

  6. <?php
    include_once ('include/connection.php');

    if(isset($_POST['submit']))
    {
    $name = $_POST['name'];
    $email = $_POST['email'];
    //mysql_query ("INSERT INTO casino_newsletter(name,email) VALUES('name','email')");
    $sql = "INSERT INTO casino_newsletter(name, email) VALUES ('$name','$email')";
    }

    ?>

    this is code but data not insert in database

  7. Almost same code i have written but no output ….tried many times. here the code … :-
    please help

    <?php
    include_once('connection.php');
    if (isset($_POST['submit']))
    {
    $Name=$_POST['Name'];
    $Address=$_POST['Address'];
    $PhoneNo.=$_POST['PhoneNo.'];
    $HightestQualification=$_POST['HightestQualification'];
    mysql_query("insert into table1 (Name,Address,PhoneNo.,HightestQualification) VALUES ('$Name','$Address','$PhoneNo.','$HightestQualification'");
    }
    ?>
    <!DOCTYPE HTML>
    <html lang="en-US">
    <head>
    <meta charset="UTF-8">
    <title> testing </title>
    </head>
    <body>
    <form action="" method="post">

    <p>Name <br/> <input type="text" name="Name"/> </p>
    <p>Address <br/> <input type="text" name="Address"/> </p>
    <p>PhoneNo. <br/><input type="text" name="PhoneNo."/> </p>
    <p>HightestQualification <br/><input type="text" name="HightestQualification"/> </p>
    <p><input type="button" value="submit" name="submit"/>
    </form>
    </body>

    </html>

  8. <?php
    include_once('connection.php');
    if(isset($POST['submit']))
    {
    $name = $_POST['name'];
    $email = $_POST['email'];
    $add = $_POST['address'];
    $adm = $_POST['admission'];
    mysql_query("insert into students_record(name,,email,address,joinig_date) VALUE ('$name','$email','$add','$adm')");

    }
    ?>
    <html>
    <head>
    <meta charset="UTF-9">
    <title> New PhP</title>
    </head>
    <body>
    <form action="" method="">
    <p>Name:<br /><input type="text" name="name" id=""/></p>
    <p>E-mail:<br /><input type="text" name="email" id=""/></p>
    <p>Address:<br /><input type="text" name="address" id=""/></p>
    <p>Admission Date:<br /><input type="text" name="admission" id=""/></p>
    <p><input type="submit" name="submit" value="Submit"/></p>
    </form>
    </body>
    </html>

    sir ap ne data base insert karne code bataya kiya to ap me (echo ) work kar raha tha but jab mai program ko run kara rahe the to  (URL ) me show hone laga

  9. Hello sir!
    your tutorial in very good for us and i am following your tutorial nowadays i'm learning php but i have a problem i want to store data in database but data is not storing …while error is not showing ….
    but when i open the database and click the browser and show it
     MySQL returned an empty result set (i.e. zero rows). (Query took 0.0004 sec)

    please sir tell me how i remove this error and how i store data in database please reply me…please sir i'm waiting….

  10. Hello sir!
    your tutorial in very good for us and i am following your tutorial nowadays i'm learning php but i have a problem i want to store data in database but data is not storing …while error is not showing ….
    but when i open the database and click the browser and show it
     MySQL returned an empty result set (i.e. zero rows). (Query took 0.0004 sec)

    please sir tell me how i remove this error and how i store data in database please reply me…please sir i'm waiting….

Leave a Reply