Jump to content

[SOLVED] EDITing records? not sure


ali_2kool2002

Recommended Posts

Hi does anyone know how to retrieve a record say from an sql database and then make editing on the same output and save it back into the same record?

I.e. i want to display all the records of a table but have an extra radio button, and when this radio button is selected along side it i want to know which record id number has been selected. The user can select more than one record and then click submit button.

could any one code a simple example which i could use to do this?

---------------------------------------------------------------------

i think i need somthing like this but dont know how in php? :'(

 

SQL QUERY>> SELECT * FROM TABLE

 

while there are results for the query{

show record

Display radio button next to it

(<input type="radio" name="driverId" value = '.$driverId.' checked> Selected )

}

submit button

 

 

 

 

 

Link to comment
Share on other sites

<?php

if($_POST['submit']){
echo $key;
}

$x=array("a" => "a was seleted" , "b" => "b was selected" , "c"  =>  "c was selected");

echo"<form method='POST' action=''>";

foreach ($x as $key => $value){

echo"<input type='radio' name='key' value='$value'>$key<br>";
}
echo"<br><input type='submit' name='submit' value='GET ME'>";

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.