The SQL statement printed from the fleaphp associated table is incorrect. & lt ;? PhpFLEA: loadClass (FLEA_Db_TableDataGateway); classTable_IpromiseusersextendsFLEA_Db_TableDataGateway {& nbsp; var $ tableNameipromise_users; the fleaphp associated table prints an incorrect SQL statement
FLEA: loadClass ('Flea _ Db_TableDataGateway ');
Class Table_Ipromiseusers extends FLEA_Db_TableDataGateway {
Var $ tableName = 'ipromise _ users ';
/**
* Specify the primary key field name
*
* @ Var string
*/
Var $ primaryKey = 'id ';
Var $ hasMany = array (
'Tableclass' => 'Table _ Ipromisevote ',
'Mappingname' => 'id ',
'Foreignkey' => 'U _ id ',
);
}
?>
This is the configuration of the document table associated with the user table.
Call in controller
$ Obj_temp = FLEA: getSingleton ('Table _ ipromiseusers ');
$ Row = array ();
If (isset ($ _ GET ['u']) |! Empty ($ u )){
$ Con = 'con ';
$ U = $ _ GET ['u'];
$ Conditions = "nums like '%". $ u. "% '";
$ Pager = new Model_extPager ($ obj_temp, $ page, 1, $ conditions, $ sort );
$ Rows = $ pager-> findAll ();}
The rows array is the data of two tables.
2. how is the SQL statement of a table on the front-end: SELECT 'BZ _ ipromise_users '. 'id' AS flea_pkref_id, 'BZ _ ipromise_users'. * FROM 'BZ _ ipromise_users'
No association. An error occurred.
------ Solution --------------------
Very simple .......