[SOLVED] value not getting passed to function variable
Posted: Sat Mar 06, 2004 11:03 pm
Hi there,
I'm passing values to a function, but am finding the value of 'highlight_id' below is not set. I'm only new to PHP so am thinking I've done something wrong, but can't work out what?
$Resultset['Title'] definitely has a value, as I've printed it to test, but 'highlight_id' has not been set to the same value as $Resultset['Title'].
$Resultset['Title'] is set further up in the script:
I actually got this script from someone else and they originally set 'highlight_id' => 4
I'm changing it as I want the listbox to select the value that is contained in the record it has retrieved rather than a static value.
I hope that makes sense?
I'm passing values to a function, but am finding the value of 'highlight_id' below is not set. I'm only new to PHP so am thinking I've done something wrong, but can't work out what?
Code: Select all
<? enhanced_list_box(array(
'table' => 'ctitle',
'id_field' => 'id',
'value_field' => 'title',
'highlight_id' => $Resultset['Title']));
?>$Resultset['Title'] definitely has a value, as I've printed it to test, but 'highlight_id' has not been set to the same value as $Resultset['Title'].
$Resultset['Title'] is set further up in the script:
Code: Select all
$Resultset = $MyDb->f_GetRecord($Result);I'm changing it as I want the listbox to select the value that is contained in the record it has retrieved rather than a static value.
I hope that makes sense?