Login Retreive lost passwordRegister
Search

Forum Index / General / dbTextSelectField error

[ This topic is solved ]

  hautin 01 April 10 / 04:54  
Hello,

First, A big thank you for your great work.

I've fot an issue with dbTextSelectField and dbSelectField (the same error for both of them).

When I try to use a dbTextSelectField field, I have this error

 $form -> dbTextSelectField("Saga","saga","jeu_saga",array( 'id', 'description' )," ORDER BY `description`",FH_NOT_EMPTY); 


leads to

Warning: class.dbTextSelectField.php at 63 Error, could not retrieve records.
Error message: Unknown column 'Array' in 'field list'
Query: SELECT Array FROM `jeu_saga` ORDER BY `description`

If I put Only

 $form -> dbTextSelectField("Saga","saga","jeu_saga",'description'," ORDER BY `description`",FH_NOT_EMPTY); 


The form works but I can't save the data of the Field.

The same typeof bug appeared in 2005 on FH but seems to have been resolved.

What should I do. Everything else is working fine

Thank you in advance

  hautin 01 April 10 / 05:00  
Changed at 01 April 10 / 05:52
sorry double posting

  Johan Wiegel (Admin) 01 April 10 / 08:06  
Changed at 01 April 10 / 08:09
dbTextSelect:

This not a bug. remember it is a textfield

This is exactly what it should do.

see the manual http://www.formhandler.net/manual/102/dbTextSelectField.html
where it stays:

$field String the field which is retrieved from the table and put into the select part of this textfield.

dbSelect: is working correctly in the last version.

  hautin 01 April 10 / 14:29  
Changed at 01 April 10 / 14:32
But I don't get it

FH is returning an error :

 class.dbTextSelectField.php at 63 Error, could not retrieve records.
Error message: Unknown column 'Array' in 'field list' 


How should we declare the array with th fields ?

I use

 $table_info = "jeu_fiche";

function FH_RUN( $iID, $aData )
{
echo "Your type or selected value '". $aData['saveInField'] ."' is saved!";
}

$oForm = new dbFormHandler();
$oForm -> dbInfo( "xxxxx", "$table_info", "mysql" );
$oForm -> dbConnect( "localhost", "xxxxx", "xxxxxx" );

// new TextSelectfield
$oForm -> dbTextSelectField(
'Saga',
'saga',
'jeu_saga',
array( 'id', 'description' ),
' ORDER BY `description`',
FH_NOT_EMPTY
);

$oForm -> submitButton( "Save" );



$oForm -> onSaved( 'FH_RUN' );
$oForm -> flush();

 


Thank you in advance

Fabrice

  Johan Wiegel (Admin) 01 April 10 / 14:33  
Changed at 01 April 10 / 14:33
<?php
$form 
-> dbTextSelectField("Saga","saga","jeu_saga",array( 'id''description' )," ORDER BY `description`",FH_NOT_EMPTY); 
?>


this should return an error, only one field is allowed, it should not be an array just a string.

Wat is you code for a dbselectfield? (not provided yet)
cause

<?php
$oForm
->dbSelectField'DB Select''dbselect''tbl_testjw', array('id','naam'), 'ORDER BY naam ASC' );
?>


is working.

  Johan Wiegel (Admin) 01 April 10 / 14:35  
<?php
// new TextSelectfield
$oForm -> dbTextSelectField(
'Saga',
'saga',
'jeu_saga',
array( 
'id''description' ),
' ORDER BY `description`',
FH_NOT_EMPTY
); 
?>


is not correct.

should be:

<?php
// new TextSelectfield
$oForm -> dbTextSelectField(
'Saga',
'saga',
'jeu_saga',
'description',
' ORDER BY `description`',
FH_NOT_EMPTY
); 
?>


It produces a textfield with the posibility to select the value, not a selectfield

  hautin 01 April 10 / 14:46  
It's working !

A big thank you for your answers.

Fabrice

  Top


powered by PHP-GLOBE   © 2004 - 2012 FormHandler. All rights reserved.   -   Open source license