003 PHP MySQL Database Beginner Tutorial – Insert Record with radio button in Hindi




Welcome Everyone, this video tutorial series is about PHP MySQL Tutorial in Hindi. This will be help for beginner who want to learn php mysql connectivity …

Original source


18 responses to “003 PHP MySQL Database Beginner Tutorial – Insert Record with radio button in Hindi”

  1. Hello Sir,

    Thank you for your tutorials.
    I have a mysql table WORKERS column names as firstname(varchar), lastname(varchar) and maritalstatus(bit).

    My Textboxes and Radio buttons values in php are:

    <input type="text" name="fname">
    <input type="text" name="lname">
    <input type="radio" name="marital" value=1>Yes
    <input type="radio" name="marital" value=0>No

    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $marital = (boolean) $_POST['marital'];

    If I run below query then It works fine.
    $sql = "INSERT INTO workers (firstname, lastname) VALUES('$fname','$lname')";

    If I run below query
    $sql = "INSERT INTO workers (firstname, lastname, maritalstatus) VALUES('$fname','$lname','$marital')";

    Error: Data too long for column 'maritalestatus' at row 1

    Your help will be highly appreciated.

  2. sir i have a query please help me….
    while writing this programe in my pc i got a trouble…
    aap koi fied empty chor dety hain to error nhi aata lekin mery pass error aata hai…

    like jb aap page ko first time load krty ho to submit button me koi value nhi hoti…
    aur submit button empty hota hai….
    lekin aap k page me notice nahi aata. lekin jb me esa karta hun to notice aata hai k submit me koi value nhi hai…

    same ese hi aap ne language waly checkbox bhi kuch empty chory lekin error nhi aaya…
    lekin mery pass error show hota hai k kuch veriables k andar koi value nhi hai

    please sir help me in this case

  3. <!DOCTYPE html>
    <html>
    <body>

    <form action="action_page.php" method="post">
    First name:<br>
    <input type="text" name="firstname">
    <br>
    Last name:<br>
    <input type="text" name="lastname">

    <input type="submit" name="submit" value="save">

    </form>

    </body>
    </html>
    <?php
    if($_POST["submit"]=="save")
    {
    $fname=$_POST["firstname"];
    $lname=$_POST["lastname"];
    mysql_connect("localhost","root","");
    mysql_select_db("test");
    $s= "insert into cotact(firstname,lastname) values('".$fname."','". $lname."')";
    mysql_query($s),
    }
    ?>

    sir i am use the same code but its not working tell me what is wrong in that please sir help me

  4. hello sir 
    thank you very much
    i am a php beginner and i want to create a online examination system. can you help me how to create online examination system in php and mysql with admin panel 
    please sir

Leave a Reply