[FX.php List] select field from value list

Jane Chinn Jane.Chinn at cwu.EDU
Fri Jul 14 09:36:52 MDT 2006


Hi,

I would like to be able to bring up an edit page with a pre-existing  
value from the database that can be edited in the same value list  
being displayed.

This is what I have but it won't show the existing value from the DB  
and won't update the DB.  All the other edit fields update, however.

// In head of page:

<?php
include_once('../FX/FX.php');
include_once('../FX/FMErrors.php');
include_once('../FX/server_data.php');

$recid=$_GET[recid];

$search=new FX($serverIP,$portNumber);
$search->SetDBData('MTISvideos.fp7','Layout1');
$search->AddDBParam('-recid',$recid);

$searchResult=$search->FMFind();
/* $searchData = current($searchResult['data']); */
foreach($searchResult['data'] as $key=>$searchData);

$v1=new FX($serverIP,$portNumber);
$v1 -> SetDBData('MTISvideos.fp7','Layout1');
$v1Result = $v1 -> FMView();

?>

// In a table in same page with edit fields

     <td align="right"><strong>Category:</strong></td>
     <td><select name="category">
		<?php
		foreach($v1Result['valueLists']['CATEGORY'] as $key => $value)
		{
		if ($searchData['real_video_new::category'][0]==$value) {
		$selected = 'selected';
		}else{
		$selected ='';
		}
		?>
		
		<option value="<?php echo $value; ?>"<?php echo $selected; ?>><?php  
echo $value; ?></option>
		<?php
		
		}
		
		?>
		</select>

     </td>

Thanks for helping with my somewhat annoying questions.

Jane


More information about the FX.php_List mailing list