Edit record using dd3 script

HalRau
06:16:14
Hello,
I have the dd3 script running on an insert record form. I would like to modify the script so it dynamically selects the values from the record set and allows them to be edited to another set of values.
Here is the working code on the insert form.
Is this possible with your code?
 <?Php
///////// Getting the data from Mysql table for first list box//////////
$quer2="SELECT DISTINCT description,id FROM usergroups order by description";
///////////// End of query for first list box////////////

/////// for second drop down list we will check if category is selected else we will display all the subcategory/////
$cat=$_GET['cat']; // This line is added to take care if your global variable is off
if(isset($cat) and strlen($cat) > 0){
$quer="SELECT DISTINCT cat_name,Cat_ID FROM categories where usergroups_ID=$cat order by cat_name";
}else{$quer="SELECT DISTINCT cat_name,Cat_ID FROM categories order by cat_name"; }
////////// end of query for second subcategory drop down list box ///////////////////////////


/////// for Third drop down list we will check if sub category is selected else we will display all the subcategory3/////
$cat3=$_GET['cat3']; // This line is added to take care if your global variable is off
if(isset($cat3) and strlen($cat3) > 0){
$quer3="SELECT DISTINCT subcat_name,Subcat_ID FROM subcategories where Cat_ID=$cat3 order by subcat_name";
}else{$quer3="SELECT DISTINCT subcat_name,Subcat_ID FROM subcategories order by subcat_name"; }
////////// end of query for third subcategory drop down list box ///////////////////////////

///------------------------------------------///

////////// Starting of first drop downlist /////////
echo "User Group:&nbsp;<select name='Doc_usergroup' onchange=\"reload(this.form)\"><option value='' selected>Select one</option>";
foreach ($dbo->query($quer2) as $noticia2) {
if($noticia2['id']==@$cat){echo "<option selected value='$noticia2[id]'>$noticia2[description]</option>"."<BR>";}
else{echo "<option value='$noticia2[id]'>$noticia2[description]</option>";}
}
echo "</select><br><br>";
////////////////// This will end the first drop down list ///////////


////////// Starting of second drop downlist /////////
echo "Category:&nbsp;<select name='Doc_Cat_ID' onchange=\"reload3(this.form)\"><option value=''>Select one</option>";
foreach ($dbo->query($quer) as $noticia) {
if($noticia['Cat_ID']==@$cat3){echo "<option selected value='$noticia[Cat_ID]'>$noticia[cat_name]</option>"."<BR>";}
else{echo "<option value='$noticia[Cat_ID]'>$noticia[cat_name]</option>";}
}
echo "</select><br><br>";
////////////////// This will end the second drop down list ///////////


////////// Starting of third drop downlist /////////
echo "Sub-Category: <select name='Doc_Subcat_ID' ><option value=''>Select one</option>";
foreach ($dbo->query($quer3) as $noticia) {
if($noticia['Subcat_ID']==@$cat4){echo "<option selected value='$noticia[Subcat_ID]'>$noticia[subcat_name]</option>"."<BR>";}
else{echo "<option value='$noticia[Subcat_ID]'>$noticia[subcat_name]</option>";}
}
echo "</select>";
////////////////// This will end the third drop down list ///////////
?>

smo1234
06-17-2014
It is no clear how from dropdown list record can be edited. However you can read this
record edit You can select the record number and the same can be edited like this.
Jamesmuvie
10-19-2014
I cant understand the script
Please Login to post your reply or start a new topic