In making an order system, you can't print anything when using a view model.
Custom View Model
Array (' id ', ' orderno ', ' Date ', ' money ', ' Memo ', ' state ', ' _type ' = ' left '), ' client ' = = Array (' ClientName ', ' _on ' = > ' order.client_id=client.id ', ' _type ' = ' right ', ' user ' = = Array (' UserName ', ' _on ' = ' order.user_id= ') User.ID '),);}? >
Table structure
After executing the following statement, print out a blank
$Model = D ("Orderview"), $result = $Model->select ();p($result);d ie;
After viewing the log file, the resulting SQL statement is
Please the great God to help you. This is a final design experiment, there will be a few days to hand in, extremely urgent, thank you!
Reply to discussion (solution)
An automatic table prefix has been added to the config file
What is wrong with the generated SQL statement execution?
What is wrong with the generated SQL statement execution?
Error message
1064:you has an error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near ' left JOIN or_client clien T on order.client_id=client.id right JOIN or_user user ' in line 1
Table aliases do not use order,
Order is a keyword ~
Table aliases do not use order,
Order is a keyword ~
As you said, it was a real success, thanks so much.