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
https://forums.phpfreaks.com/topic/41981-solved-editing-records-not-sure/
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'>";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.