Jump to content

[SOLVED] Simple php problem


SocomNegotiator

Recommended Posts

Does anyone know why this does not work...

 

<select name="name" id="name">

          <option selected="selected">          </option>

          <?

         

    $sql2 = "SELECT * FROM teams ORDER BY name ASC";

    $result2 = mysql_query($sql2);

    while($data2 = mysql_fetch_array($result2))

    {

      $country = $data2['name'];

  echo "<option value='$country'>$country</option>";

  }

    ?>

        </select>

Link to comment
https://forums.phpfreaks.com/topic/100591-solved-simple-php-problem/
Share on other sites

<?php
           
     $sql2 = "SELECT * FROM teams ORDER BY name ASC";
     $result2 = mysql_query($sql2) or die(mysql_error());
     while($data2 = mysql_fetch_array($result2))
     {
      $country = $data2['name'];
   echo "<option value=$country>$country</option>";
  }
     ?>
     

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.