Fleaphp joined table printed SQL statement incorrect solution

Source: Internet
Author: User
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 .......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.