ahmedarkan Posted June 27, 2013 Share Posted June 27, 2013 (edited) HelloI have the data in the database for a client appear in the fields of input type = text ... Is it possible modification or replacement of the data within the fields to anything I want to do by the submit button replaces the data that I have typed the previous allowance in the database table? And how?I want exactly similar way when the edit data in phpmyadmin. like this : This review of the data code ... I want to make the update button on this page. $name = addslashes($_POST['dname']); $con=mysqli_connect("localhost","root","","ahmedark_depot"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM driver_info WHERE driver_name ='$name'"); while($row = mysqli_fetch_array($result)) { echo "drivername: <input type=\"text\" name=\"id\" value = \"$row[id]\"><br /><br />" ; echo "drivername: <input type=\"text\" name=\"driver_name\" value = \"$row[driver_name]\"><br /><br />" ; echo "prevent: <input type=\"text\" name = \"prevent\" value = \"$row[prevent]\"><br /><br />" ; echo "note prev: <input type=\"text\" name = \"note_prev\" value = \"$row[note_prev]\"><br /><br />" ; echo "note : <input type=\"text\" name = \"general_note\" value = \"$row[general_note]\"><br /><br />" ; } mysqli_close($con); ?> Edited June 27, 2013 by ahmedarkan Quote Link to comment https://forums.phpfreaks.com/topic/279644-how-can-i-do-an-update-on-the-inside-of-the-fields-that-display-data/ Share on other sites More sharing options...
dalecosp Posted July 1, 2013 Share Posted July 1, 2013 link tramadol hcl effects - buy ultram online no prescription Moderator, please axe this blasted spammer, plx! Quote Link to comment https://forums.phpfreaks.com/topic/279644-how-can-i-do-an-update-on-the-inside-of-the-fields-that-display-data/#findComment-1438865 Share on other sites More sharing options...
dalecosp Posted July 1, 2013 Share Posted July 1, 2013 (edited) Hello I have the data in the database for a client appear in the fields of input type = text ... Is it possible modification or replacement of the data within the fields to anything I want to do by the submit button replaces the data that I have typed the previous allowance in the database table? And how? I want exactly similar way when the edit data in phpmyadmin. like this : This review of the data code ... I want to make the update button on this page. $name = addslashes($_POST['dname']); $con=mysqli_connect("localhost","root","","ahmedark_depot"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM driver_info WHERE driver_name ='$name'"); while($row = mysqli_fetch_array($result)) { echo "drivername: <input type=\"text\" name=\"id\" value = \"$row[id]\"><br /><br />" ; echo "drivername: <input type=\"text\" name=\"driver_name\" value = \"$row[driver_name]\"><br /><br />" ; echo "prevent: <input type=\"text\" name = \"prevent\" value = \"$row[prevent]\"><br /><br />" ; echo "note prev: <input type=\"text\" name = \"note_prev\" value = \"$row[note_prev]\"><br /><br />" ; echo "note : <input type=\"text\" name = \"general_note\" value = \"$row[general_note]\"><br /><br />" ; } mysqli_close($con); ?> If I'm understanding correctly, you want to make your output into an HTML form which can be submitted and make changes in the data. If you cannot use PHPMyAdmin to do this (I'm presuming because you do not wish for WWW users to have access to PHPMyAdmin ), then you'll first need to modify your output to have "<form>" tags (which may have already been done, you do seem to have <input> tags), and then write a handler for the POSTed data. For a basic button, you need this: <input type='submit'>You must make sure the form has a "method" attribute of "post" and an action attribute that points to your handler script:<form method="post" action="myhandler.php">You can see what is in the post array like this: print_r($_POST); Edited July 1, 2013 by dalecosp Quote Link to comment https://forums.phpfreaks.com/topic/279644-how-can-i-do-an-update-on-the-inside-of-the-fields-that-display-data/#findComment-1438867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.