The zendframework controller click to submit the specified webpage and cannot access the test. the array of the obtained form can normally output the table model.

Source: Internet
Author: User
The zendframework controller click Submit. the specified webpage cannot access the test. the array of the obtained form can normally output the table model.
The webpage you specified cannot be accessed!
Error Type: 500

Controller code
Public function additemAction (){
$ Name = $ this-> getRequest ()-> getParam ('name ');
$ Description = $ this-> getRequest ()-> getParam ('Description ');
$ Vote_count = $ this-> getRequest ()-> getParam ('vote _ count ');

/*
Echo $ name, $ description, $ vote_count;

Exit ();*/


$ Data = array (
'Name' => $ name,
'Description' => $ description,
'Vote _ count' => $ vote_count
);


$ ItemModel = new Item ();
$ ItemModel-> insert ($ data );
$ This-> redirect ('OK ');
}



Item. php

// Here Zend_Db_Table must be inherited; otherwise, it is not a table model.
Class Item extends Zend_Db_Table {
// The default primary key is id, which can be left empty
Protected $ _ primary = 'id ';
Protected $ _ name = 'ITEM ';


}


Reply to discussion (solution)

Is your database configured?

"The specified webpage cannot be accessed" Is there a problem with the submitted path?

$ This-> _ redirect ('OK ');

Is the problem solved? I have the same problem.

Ask the master to solve the problem.

Bro, I finally found out why.
That is, if the spelling of a field name in the item table in mysql is incorrect, this result will be returned.
Description is written as descrption in the item table, with a letter I missing.
It took a whole week.

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.