The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Insert data in to the textbox in PHP Reply To: Insert data in to the textbox in PHP


First of all thanks a lot for your feedback .
i answer of the below question and i know it from and tutorialpoints . my query also resolved . …

Does your database exist yet? (do you know how to create one?)
Does your database table exist yet? (does it have any records in it?)
Do you have a connection to your database? (do you know how to connect to it?)
Do you know how to query the database?
Do you know how to retrieve the results?

Since last week i started learning PHP , HTML and now i am trying to create web page where i can select,update , add and delete on web page it self. i could complete select and add . now i will start coding for update edit and delete.

please guide me to get more knowledge so that i can be perfect.

actually i was working in logistic company (KPO), but wanted to join IT so i left the previous job and now i am in my own field. everyday some or the other thing is new learning in this field . sorry to trouble you.

here is the code for add data in to the table .

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”&gt;
<html xmlns=””&gt;
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<meta name=”description” content=”” />
<meta name=”keywords” content=”” />
<meta name=”author” content=”” />
<link rel=”stylesheet” type=”text/css” href=”style.css” />
<title>First web page</title>


<?php include(‘includes/header.php’); ?>

<?php include(‘includes/nav.php’); ?>

$con = mysql_connect(“localhost”,”root”,””);

echo “successfullu”;
}else{ echo mysql_error();}*/


$sql=”insert into emp_data values(”,’$name’,’$email’,’$date’,’$mobile’, ‘$gender’,’$lang’)”;
$rec_insert = mysql_query($sql);
echo “entered data succesfully”;
echo “entered data not succesfully”.mysql_error();

<h3>Paragraph Element</h3>

<form action=”” method=”post”>
<table width=”400″ height=”109″ border=”1px solid black” >

<td width=”63″>Name</td>
<td width=”169″>E-mail</td>
<td width=”85″>DOB</td>
<td width=”104″>Mobile_No</td>
<td width=”50″>Gender</td>
<td width=”69″>Language</td>
<tr id=”bgcolor”>

<td class=”back”><input type=”text” name=”name” /></td>
<td class=”back”><input type=”text” name=”email” /></td>
<td class=”back”><input type=”date” name=”date” /></td>
<td class=”back”><input type=”text” name=”mobile” /></td>
<td class=”back”><input id=”bgcolor” type=”radio” name=”gender” value=”M” checked=”checked”>M</input> <input type=”radio” name=”gender” value=”F”>F</input></td>
<td class=”back”><select name=”lang”><option value=”English” >English</option>
<option value=”Marathi”>Marathi</option>
<option value=”Hindi”>Hindi</option> </select></td>

<td colspan=”7″><input type=”submit” value=”Submit” name=”sub” /> <input type=”button” value=”Back”/> </td>

<?php include(‘includes/sidebar.php’); ?>

<?php include(‘includes/footer.php’); ?>