Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

value not getting passed to function variable 1

Status
Not open for further replies.

drmsolutions

Programmer
Joined
Mar 7, 2004
Messages
6
Location
AU
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?

Code:
<? 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:
$Resultset = $MyDb->f_GetRecord($Result);

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?
 
probably losing scope for the RS value....try assigning to a variable and then using the GLOBAL keyword to id that value
 
That was it!! Thanks so much...this one had me stumped for a while...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top