Page 1 of 1

Can I put a variable within the []

Posted: Sun Feb 16, 2003 7:31 pm
by 3dron
I am trying to echo the value under a column set by the pick number in another database.

$entry = pick.$row_Vote['pick1'];
Now if I echo $entry I get let's say 'pick2'

Now how can I put $entry in the statement below, where is says variable here?

echo $row_RecordName['variable_here'];

O amtrying to store only number values of a players picks. Then later cross reference the numbers with the names for each category.

Posted: Sun Feb 16, 2003 7:40 pm
by Stoker
Quotes generates strings, put the string in a variable and you can use that instead...


echo $arrayvar['beer']

is the same as

$mystringvar = 'beer';
echo $arrayvar[$mystringvar];