I am looking for away a person can edit a particular row in a data base via a form that it connects to a database then table then row (BY ID) and then a user can update.change the information in that row I have been looking online but cant find a simple and full tutorial on it Any help welcomed ie it will added to a sessions page
Try this ... If ($_GET['edit']){ $id = $_GET['edit']; $sql = "SELECT * FORM table WHERE id = '$id'"; // Run query and get back $data $f1 = $data['f1']; ... } else if (isset($_POST['submit']) && is_member) { // is_member is session variable return true if member online,... $sql = "UPDATE table SET f1 = '$f1', .... WHERE id = '$id'"; } ... Code (markup): design form as you want. Do more to make it complete. Maybe this is on your way.
Something similar on another forum, this *may* help... http://webdeveloper.com/forum/showthread.php?t=209907
Hi Why Mr. Kids use $_GET method in if function & $_POST method in if...else function. But if function is true then data have less secure from if...else function. So I thing it is not really perfect way to edit a row. Gd day. Munni
When u are editing a row, it means that row is already into database and will have an id(primary key). When are you posting form put that id into <input type="hidden" name="id" id="id" value="<?php echo $id; ?>">. When you click on update write the query as update table .... where id=$_REQUEST['id'];