SOLVED [PHP] var-vars question
| From: | heinisch at creaction dot de | Date: | Thu, 09 May 2002 10:39:14 +0000 |
| Subject: | SOLVED [PHP] var-vars question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96792@lists.php.net to get a copy of this message | ||
I don´t know why the original mail took so much time,
but in the meantime the problem is solved.
The problem was, that the vars were not "global" in the class´s function.
So the returned values wouldn´t be visible inside. I just made the var
another option in the calling command, and everything works fine.
Oliver
At 07.05.2002 18:46, you wrote:
Hi folks, Linux, PHP3 I have the following problem: I have an object, which creates a form, wherein there are selects, which names accord to values in the database. But I didn´t get it to have a variable var, I´m sure it´s just a small thing, but I cannot see it Any suggestions ? TIA Oliver echo '<form name="g94" action="'.$to_go.'" method="get">'; // Already tried post, no difference echo '<table border="1" width="100%" cellpadding="1" cellspacing="1">'; while($da=$MKA -> getDbAns()) // This gives back an array named $da while there are answers {$xwert=$da[1];// $da[1] contains "abc" the var $xwert will be "abc" // now I´d like to see the value of $abc but there´s nothing inecho '<tr><td> '.$$xwert.'</td><td>';// set the new select named "abc"echo '<select name="'.$da[1].'">';// forget the rest, just for understanding what while doesfor($i=0; $i < 11 ; $i++) { if(isset($$da[1])) // just for testing { echo "<option selected >".$i."</option>"; } else { echo "<option>".$i."</option>"; } } // end for echo '</select>'; echo '</td>'; echo '<td>'.$da[1].'</td>'; echo '<td>'.$da[2].'</td>'; echo '<td align="right">'.$da[3].' EUR</td>'; echo '</tr>';} // end while echo '</table>'; echo '<br><br><input type="submit" value="CalC !">'; echo "</form>"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php