|
Posted by Phil on 09/02/06 14:12
mantrid wrote, On 3/09/06 1.19 a:
> echo "<option value='$noticia[TopicID]'>$noticia[Topic]</option>";
The problem is in the way that you reference the $noticia array. In your
first example, you a double-quoted string, this causes PHP to
automatically grab the value from the array, but in your second example...
> <option value="<?php $noticia[TopicID]; ?>"><?php $noticia[Topic];
You don't. You'll need to give it the key of the array as a string, like
$noticia['TopicID']
When using double-quoted strings, something like "$array[key]" will grab
the variable $array['key'], unless you use curly-braces like
"{$array['key']}".
See:
<http://nz.php.net/manual/en/language.types.string.php#language.types.string.parsing.simple>
-Phil
Navigation:
[Reply to this message]
|