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 concepts. Various php mysql database…
Original source
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 concepts. Various php mysql database…
Original source
12 responses to “004 PHP MySQL Database Beginner Tutorial – PHP Checkbox Array – MySQL Insert Record part 1 – Hindi”
Thankyou!, bht acha sikhaya hai, keep it up
thank you so much
as Salaam wakekum sir AP ka vedio clear nhi Ata hai dekhne me dikkat Hoti hai dhundali vedio ATI hai
can you share me your mobile number (my mob :8339857611)
plz plz plz call me or share me your contact nunber
CAN YOU JUST GIVE ME THE END RESULT CODE PLEASE!
sir change varchar to int to get 0 in the database
here is the code
<html>
<head>
<title>
php practiece
</title>
</head>
<body>
<form method="post">
Enter your first name<input type="text" name="fname" ><br>
Enter your last name<input type="text" name="lname"><br>
Gender <input type="radio" name="g" value="male">
Male
<input type="radio" name="g" value="female">
Female
<br>
Languages
<input type="checkbox" name="l1"> English
<input type="checkbox" name="l2"> Bangla
<input type="checkbox" name="l3"> Hindi
<br>
<input type="submit" value="save">
</form>
</body>
</html>
<?php
if($_POST["submit"]=="save")
{
$fname= $_POST["fname"];
$lname= $_POST["lname"];
$gender= $_POST["g"];
$l1= $_POST["l1"];
$l2= $_POST["l2"];
$l3= $_POST["l3"];
echo "<pre>";
print_r($_POST);
echo "</pre>";
exit;
mysql_connect("localhost","root","");
mysql_select_db("test");
$s="insert into contact(fname,lname,gender) values('".$fname."','".$lname."','".$gender."')";
if(mysql_query($s))
echo"Successful";
else
echo mysql_error();
}
if($_POST["submit"]=="save") whats wrong with this statement??? showing Notice: Undefined index: submit in C:xampphtdocsindex.php
Sir ye Error Araha ha Mane same ap jaisa code likha ha… Plz help me
Notice: Undefined index: l3 in C:wampwwwyoutube-practiseinsertdata-checkbox.php on line 10
Notice: Undefined index: l4 in C:wampwwwyoutube-practiseinsertdata-checkbox.php on line 11
Line number 10: $l3= $_POST['l3'];
Line number 11 $l4= $_POST['l4'];
Full Code:
<form action="" method="post">
First Name: <input type="text" name="fname"><br>
Last Name: <input type="text" name="lname"><br>
Gender: <input type="radio" name="g" value="male">Male
<input type="radio" name="g" value="female">Female <br>
Languages <input type="checkbox" name="l1" value="1"> urdu
<input type="checkbox" name="l2" value="1"> Sindhi
<input type="checkbox" name="l3" value="1"> English
<input type="checkbox" name="l4" value="1"> Balochi<br>
<input type="submit" name="submit" value="sumbit">
</form>
<?php
if(isset($_POST['submit']))
{
$fname= $_POST['fname'];
$lname= $_POST['lname'];
$gender= $_POST['g'];
$l1= $_POST['l1'];
$l2= $_POST['l2'];
$l3= $_POST['l3'];
$l4= $_POST['l4'];
/*echo "<pre>";
print_r($_POST);
echo "</pre>"; exit;*/
$con = mysqli_connect('localhost','root','') or die("Error in Connection");
$database= mysqli_select_db($con, 'databaseconnection') or die("database connection error");
if( $query= mysqli_query($con, "insert into biodata (fnme,lname,gender,urdu,sindhi,english,balochi) values('$fname','$lname','$gender','$l1','$l2',$l3,$l4) ") )
{
echo "Record Inserted";
}
else
{
echo mysqli_error($con);
}
}
?>
NiCe Sir Thank You sir ap ny mera adha course complete keya
Thank you so much..
God bless you……
Great Tutorial !!! How can I insert the same data into Excel sheet ?