Page 1 of 1

dropbox not populating

Posted: Mon Jul 04, 2011 11:12 am
by angelic_devil
plz help...the code below doesn't populate the dropbox with the records

Code: Select all



<?
// Initializes a list of acceptable category
$category_list = array();

$query_category = " SELECT categorylist.categoryname from categorylist ";

       $result_category = mysql_query($query_category);
        confirm_query($result_category);
        
      
        
        $category_list[]=" ";
  while ($record = mysql_fetch_assoc($result_category)) {
          $category_list[] = $record['categoryname'] ;
          echo '<option>'.['categoryname'].'</option>';
          
        }
$category = $_GET['categoryname'];
 
      
 
 ?>

Re: dropbox not populating

Posted: Mon Jul 04, 2011 11:29 am
by social_experiment

Code: Select all

<?php
while ($record = mysql_fetch_assoc($result_category)) {
          $category_list[] = $record['categoryname'] ;
          echo '<option> '. $record['categoryname'] . '</option>';          
}
?>

Re: dropbox not populating

Posted: Mon Jul 04, 2011 1:31 pm
by angelic_devil
doesn't work

give the error

'. $record['categoryname'] . ''; } } //$category = $_GET['categoryname']; ?>

Re: dropbox not populating

Posted: Mon Jul 04, 2011 3:02 pm
by angelic_devil
OK i got it to work...little change in code

Re: dropbox not populating

Posted: Mon Jul 04, 2011 3:59 pm
by social_experiment
Out of curiosity, what error did you get?

Re: dropbox not populating

Posted: Mon Jul 04, 2011 9:55 pm
by Jonah Bron
@social_experiment: I'd say his (local)host had short tags disabled :)