Newbie needs ComboBox Help



Does anyone know how to populate a comboBox from a database query
 
when I write the code this way it only puts one number in the combo box
 
Begin Query
######################################33
 
$stores = array();
 
 $sql= "Select store_number from store";
 $result = mysql_query($sql);
 
$row = mysql_fetch_array($result, MYSQL_NUM);
$num_rows = mysql_num_rows($result);
 
for($i = 0; $i < $num_rows; $i++) {

$stores[$i] = "$row[0]";

}
 
#######################################################
This is the combo code that i am trying to populate
#########################################################3
 
 

$audit_store_numberacombo = &new GtkCombo();
$audit_store_numberacombo->set_popdown_strings($stores);
$audit_store_numbera = $audit_store_numberacombo->entry;
$audit_store_number_labela->add($audit_store_numberacombo);
 
##############################################################
I just started learning gtk-php and php so any help would be great
 
Thanks
James
 
 
 
 
 
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]