Which of the following statements are combined during insert in ZendFramework? I have been having problems with SQL. SupportsParameters
Source: Internet
Author: User
Which of the following statements are combined during insert in ZendFramework? My SQL has been faulty. What does supportsParameters mean? In Controller: $ table = newModel_Users (); $ dd = array ('username' = & gt; $ username, 'password' = & gt; what is the combination of insert statements in Zend Framework? My SQL has been faulty. What does supportsParameters mean?
In Controller:
$ Table = new Model_Users ();
$ Dd = array ('username' => $ username, 'password' => md5 ($ password), 'name' => $ name, 'Email '=> $ email,
'Reg _ time' => date ("Y-m-d H: m: s", time ()), 'ipaddr '= >$ _ SERVER ['remote _ ADDR']);
$ Test = $ table-> insert ($ dd );
Then there is always an error. after tracking, I found my SQL in public function insert ($ table, array $ bind) in zend_db_adapter_abstract.
When $ this-> supportsParameters ('positional'), all values in the table are set to "?". What does this function mean?
Is the database configuration a problem?
Code: 549cell in zend_db_adapter_abstract.
------ Solution --------------------
First, check the value returned by supportsParameters ('positional ').
I 'd better post it.
Then, check whether the variable you want to assign values is consistent with that of the variable? The number is the same. Whether the variable name in the value assignment is consistent with the corresponding field name
------ Solution --------------------
1. according to your Db Adapter, ZendDB may have called mysqli or pdo mysql. both extensions have bind operation functions, and then the code runs to the c part of the function.
2. it is not an error-log, but a mysql log. it may not be enabled in my. cnf,
See here: http://www.howtogeek.com/howto/database/monitor-all-sql-queries-in-mysql/
Discussion
Upstairs, thank you for your consideration. try catch. I have two questions that I don't quite understand. please advise!
1. how does one use the underlying c? Is there a simple example?
2. I went to mysql to find log and show error-log, but I couldn't see anything here?
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