Hello to all
First, I apologize for my English certainly terrible!!
Here's my problem
I am carrying out a form with XOOPS classes for a new module
I have create a SELECT menu (drop down) which takes data from a table.
Table called umus_format and his 2 fields format_id and format_title
drop down displays all values but not showing the values that begin with a number...
ex. CD,DVD,LP are ok 2CD,2DVD,2LP do not appear
Here is the code.
// Controllo se esistono i formati altrimenti non posso creare una recensione e vengo rimandato alla pagina dei formati
$result2 = $xoopsDB->query( "SELECT count(format_id) as count FROM ".$xoopsDB->prefix("umus_format")."" ) ;
list( $count ) = $xoopsDB->fetchRow( $result2 ) ;
if( $count < 1 ) {
redirect_header(XOOPS_URL."/modules/umusic/admin/admin_format.php",2,_MI_UMUS_MUSTADDFORMATFIRST);
exit();
}
$umus_format = $xoopsDB->prefix( "umus_format" ) ;
$ftree = new XoopsTree($umus_format,"format_id", "format_title" ) ;
// Creo la select per mostrare i formati
$format = new XoopsFormSelect( _MI_UMUS_REV_SELECTFORMAT , "format_id" , $format_id ) ;
$treef = $ftree->getChildTreeArray( 0 , "format_id" ) ;
foreach( $treef as $leaff ) {
$leaff['prefix'] = substr( $leaff['prefix'] , 0 , -1 ) ;
$leaff['prefix'] = str_replace( "." , "--" , $leaff['prefix'] ) ;
$format->addOption( $leaff['format_id'] , $leaff['prefix'] . $leaff['format_title'] ) ;
}
//
$my_form->addElement( $format ) ;
if I make a normal query to the database I see that all values are inserted correctly
Mysql code
CREATE TABLE umus_format (
format_id tinyint(3) unsigned NOT NULL auto_increment,
format_title varchar(255) NOT NULL default '',
PRIMARY KEY (format_id)
) TYPE=MyISAM;
INSERT INTO umus_format (format_title) VALUES ('CD');
INSERT INTO umus_format (format_title) VALUES ('2CD');
INSERT INTO umus_format (format_title) VALUES ('DVD');
INSERT INTO umus_format (format_title) VALUES ('2DVD');
INSERT INTO umus_format (format_title) VALUES ('LP');
INSERT INTO umus_format (format_title) VALUES ('2LP');
INSERT INTO umus_format (format_title) VALUES ('12"');
INSERT INTO umus_format (format_title) VALUES ('10"');
INSERT INTO umus_format (format_title) VALUES ('7"');
INSERT INTO umus_format (format_title) VALUES ('Digital');
INSERT INTO umus_format (format_title) VALUES ('Cassette');
INSERT INTO umus_format (format_title) VALUES ('Altro');
which may be the problem? I have perhaps found a bug?
Urban