Jump to content

Combo box keeps show empty records ! help


redpedia

Recommended Posts

Hello , i have a strange problem

 

i am trying to populate a combo box from mysql database, here is the code

<?php
	 include("functions.php"); 
	 mysql_connection();

	 $sql_query= mysql_query("select category_id,category_name from categories");
	 ?>

<select name="category" id="category">
          <option value="Choose">Choose</option>
         <? 
	while($fetch= mysql_fetch_array($sql_query)) 
	{  ; ?>
         
          <option value= " <? $fetch[category_id]; ?> " selected="selected"><? $fetch[category_name]; ?> </option>
	 <? 
        }
  		 ?>
        </select>

 

 

there is no errors but it keeps showing blank records or spaces inside the combo box, i mean i have 3 records now in the table , the combo box just retrieve blank 3 spaces ! , where is the problem please ? 

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/195838-combo-box-keeps-show-empty-records-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.