var-vars question

From: Date: Tue, 07 May 2002 16:46:35 +0000
Subject: var-vars question
Groups: php.general 
Request: Send a blank email to php-general+get-96459@lists.php.net to get a copy of this message
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 in
      echo '<tr><td> '.$$xwert.'</td><td>';
// set the new select named "abc"
      echo '<select name="'.$da[1].'">';
// forget the rest, just for understanding what while does
      for($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>";

« previous php.general (#96459) next »