Incredinot Posted May 19, 2010 Share Posted May 19, 2010 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 More sharing options...
phpchamps Posted May 19, 2010 Share Posted May 19, 2010 Try ....... foreach($row as $key=>$value){ echo $value; } Link to comment https://forums.phpfreaks.com/topic/202236-foreach-help/#findComment-1060441 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.