We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Question regarding Tutorial 1

Hi all,

Although it's the first day I study Phalcon, I've already found that it's a very friendly and efficient tool. I followed the instructions in Tutorial 1, everything work smoothly but I encounter an error at "save". I didn't use the exact same "user" table, but I have a table which has only integer columns; then when I pass my form inputs to save, it's actually strings when they hit the backend, it cause the program aborted and Chrome shows a "No data received" error. I would like to know is there anything I may possibly missed and cause this error? More precisely, I was expecting a message from Phalcon instead of nothing sent to my browser.

My second question is regarding the SQL injection. In the tutorial, it said that the SQL injection has already been taking cared, that means I can really just let the visitor play with the input and don't have to sanitize the inputs?

Sincerely, Chi



2.2k

I didn't use the exact same "user" table, but I have a table which has only integer columns

Probably it is the cause of the error. Why don't you create exact the same table at first?



43.9k

Hi,

Some tips for debuging your app:

  • use chrome console to see (in network tab) if data are sent while submiting your form and what kind of http response you get (200: success, 500: internal server error ...)
  • if you get a 500 code then check your webserver errors.log file because you may find there some usefull information
  • make an abusive use of var_dump() in your buged controller action
  • phalcon debug component is also a good tool


25.7k

Hi Kenjis,

Because I would like to test it in a broader way, and I'm actually glad that I encounter this issue before it happens to my real application.

I didn't use the exact same "user" table, but I have a table which has only integer columns

Probably it is the cause of the error. Why don't you create exact the same table at first?



25.7k

Hi le51,

Thanks for your answer, I should definitely check them out.

Hi,

Some tips for debuging your app:

  • use chrome console to see (in network tab) if data are sent while submiting your form and what kind of http response you get (200: success, 500: internal server error ...)
  • if you get a 500 code then check your webserver errors.log file because you may find there some usefull information
  • make an abusive use of var_dump() in your buged controller action
  • phalcon debug component is also a good tool


25.7k
edited Dec '14

I checked my error log and there is an "exit signal Illegal instruction (4)", and I found this forum post. We are both using AWS Elastic Beanstalk, I'm not sure if that's the issue.

in addition in tutorial 2 it mentioned: "the ORM escapes the input data and performs additional casting according to the column types." The error that happened to me is because it wasn't casted properly?



43.9k

Hi;

I do not own any knowledge of AWS beanstalk, but if you have the ability to compile phalcon with that service, you should definitively try phalcon's suggestion in https://forum.phalcon.io/discussion/1540/problems-with-aws-beanstalk-and-phalcon#C8267