We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Can't write to the db

Hi I have the following function:

public function addAction($name,$rating=null,$address,$city,$district=null ,$description=null){

       echo "processing";
       $chat= new Chat();


       echo "till here";

       $institution= new Institution();
       echo "wb here";
   }catch (ErrorException $e){
       echo $e;



The output I have when I go thru the defined toute is only "processing" (the first 'echo") , nothing is added to the db. I figure out where the mistake can be.


hi, try this:

if($chat->save() == false)
foreach($chat->getMessages() as $mes)
        echo $mes;

edited Dec '16

If you are on developer machine you could remove try catch block and see php error information and line in your browser, and, assuming you have xdebug, much more. If you don't, I suggest you take some time to install it.

Otherwise you can use:

echo ($e->getCode());

inside catch.