Jump to content

foreach help


Incredinot

Recommended Posts

Hi..

 

I have this piece of code where "$key['title']" only show a letter or number instead of the accual title..

 

What am i doing wrong?

 

<?php 

// Connect
mysql_connect("xxxxx", "xxxxx", "xxxxx") or die(mysql_error());
mysql_select_db("xxxxx") or die(mysql_error());

// Code
$result = mysql_query("SELECT * FROM bookinger WHERE active='YES'") or die(mysql_error());
$row = mysql_fetch_array($result); ?>
<label>
  <select name="select" id="select">
    <?php foreach($row as $key){?><option value="<?php echo $key['id'];?>"><?php echo $key['title'];?> </option><?php } ?>
  </select>
</label>

Link to comment
https://forums.phpfreaks.com/topic/202236-foreach-help/
Share on other sites

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.