Dear all I have the following codes for editing my filed record. records are displayed , but i dont know the codes for making editable form, Pleasde help me . Mr. sangpo ############### Code <?php $username = "root"; // Mysql username $password = ""; //Mysql password $server = "127.0.0.1"; // Server $db_name = "test"; // database name $tbl_name = "test_mysql"; // table name // Connect to server and select database. mysql_connect("$server", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); mysql_connect("$server", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $search = $_POST["search"];$result = mysql_query("SELECT * FROM test_mysql WHERE id LIKE '%$search%' OR name LIKE '%$search%' OR lastname LIKE '%$search%' OR email LIKE '%$search%'"); echo "<table width=700 border=1>"; echo "<tr bgcolor=ffffff align=middle font-size=50> <th>id</th> <th>Name</th> <th>LastName</th> <th>email</th> </tr>"; while($row=mysql_fetch_array($result)) { $id=$row["id"]; $name=$row["name"]; $lastname=$row["lastname"]; $email=$row["email"]; echo "<tr><td><a href='2update.php?id=$id'>$id</a></td><td>" . $name . "</td><td>" . $lastname . "</td><td>" . $email . "</td></tr>" ; }echo "</table>";?> </p><p> </p></body></html>
You don't have a form, you have a table. I suggest you have a quick look at some of the resources available to you which will help you along with using a form to update a database. http://www.phpeveryday.com/articles/PHP-MySQL-Creating-Form-Insert-Data-P280.html http://www.jotform.com/help/126-How...-submissions-to-your-MySQL-database-using-PHP http://www.phpeasystep.com/mysql/9.html