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> Quote Link to comment 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; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.