I knw little bit in java script.
the following is a piece of my code. In this i dnt knw were to add to get input field i text box
Code:
<html>
<head>
<title>QBank</title>
</head>
<body>
<form name="Board" action="boards1.php" method="post">
id :<input type="text" name="sid">
name : <input type="text" name="sname"><br>
<table border="1">
<tr><th>Id</th><th>Name</th></tr>
<?
include("config.php");
$sql1="select * from Boards order by id";
$res1=mysql_query($sql1);
while($row = mysql_fetch_array($res1))
{
echo "<tr><td>$row[0]</td><td>$row[1]</td></tr>";
}
?>
</table>
<input type="submit" value="Save" name="insert" />
<input type="submit" value="update" name="update"/>
<input type="submit" value="clear" name="clr"/>
</form>
</body>
</html>
Code:
<?php
include("config.php");
$id=$_POST['sid'];
$name=$_POST['sname'];
$update=$_POST['update'];
//$save=$_POST['insert'];
echo $update." ".$id." ".$name." ";
/*if(($sav=="Save"))
{
echo "hai";
$sql="insert into Boards(id,name)values($id,'$name')";
$res=mysql_query($sql);
}*/
if(($update=="update"))
{
//echo "hai1";
$sql1="update Boards set name='$name' where id=$id";
echo $sql1;
$res1=mysql_query($sql1);
if($res1)
echo "<script>($res1)</script>";
}
?>
any1 please tell me