editable form

Discussion in 'PHP' started by sangpo, Oct 22, 2012.

  1. #1
    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>&nbsp;</p></body></html>
     
    sangpo, Oct 22, 2012 IP
  2. scottlpool2003

    scottlpool2003 Well-Known Member

    Messages:
    1,708
    Likes Received:
    49
    Best Answers:
    9
    Trophy Points:
    150
    #2
    scottlpool2003, Oct 23, 2012 IP