Database problems encountered using Phalcon development tools "Table ' XXX ' doesn ' t exist in database when dumping meta-data for XXX"

Source: Internet
Author: User
Tags array to string

Use the Phalcon development tool to generate the program framework from the command line

Set up the config.php, when the database to read, save data when there is a problem "Table ' XXX ' doesn ' t exist in database time dumping meta-data for XXX"

Notice that there is also a statement "Array to string conversion" above, to find the code corresponding to services.php

1 $di function  Use ($config) {2     return New Dbadapter ($config-ToArray ()); 3 });

View $config content again

$config include __dir__. "/.. /app/config/config.php ";

config.php Content

1<?PHP2 3 return New\phalcon\config (Array(4' Database ' =Array(5' Adapter ' = ' Mysql ',6' Host ' = ' localhost ',7' Username ' = ' root ',8' Password ' = ',9' dbname ' = ' eduhelper ',Ten' CharSet ' = ' utf8 ', One), A' Application ' =Array( -' Controllersdir ' = __dir__. ‘/.. /.. /app/controllers/', -' Modelsdir ' = __dir__. ‘/.. /.. /app/models/', the' Migrationsdir ' = __dir__. ‘/.. /.. /app/migrations/', -' Viewsdir ' = __dir__. ‘/.. /.. /app/views/', -' Pluginsdir ' = __dir__. ‘/.. /.. /app/plugins/', -' Librarydir ' = __dir__. ‘/.. /.. /app/library/', +' Cachedir ' = __dir__. ‘/.. /.. /app/cache/', -' BaseUri ' = '/eduhelper/', +     ) A));

The analysis is the database connection that block out the problem, you can see there is a ' application ' in the $config, and we need obviously only ' database '

The code at services.php should be changed to

1 $di function  Use ($config) {2     return New Dbadapter ($config->database->ToArray ()); 3 });

Or

$di function  Use ($config) {    returnnew dbadapter ($config[' Database ']->  ToArray ());});

Database problems encountered using Phalcon development tools "Table ' XXX ' doesn ' t exist in database when dumping meta-data for XXX"

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.