Strange, my php scripts only showing up php errors and when encounter pdo errors it shows internal server error in console. This is an ajax post btw, so how do i enable the server to show pdo errors as well along php errors ?
Thanks i got it. But why the error was not displayed? i wasted lot of time trouble shooting. if it had tell about a missing quote , i would fixed instantly. btw, ill chec for the sql injection issue also. Thanks. pls help me display errors.
I agree, but it also ties in with logical thinking as well. Even if you don’t have an IDE such as myself because I prefer lite weight text editors like Sublime Text, you have to do logical thinking and look at each line. Ask yourself if it makes sense. Then continue to the next line. Repeat this process until you have gone through all the lines in that file. This is just a few techniques I use in lite weight text editors like Sublime.
i just added the double quote where dormilich mentioned. well, until then the program was showing up internal server error. but now i see php errors after that. i wonder why php did not tell me about the missing double quote while it is showing up other errors.
**Notice** : Undefined variable: day17 in **/home/accessto/public_html/demo3/admin/content/dashboard/pages/client_admin/packages/add/add.php** on line **87**
**Fatal error** : Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'price' in 'field list'' in /home/accessto/public_html/demo3/admin/content/dashboard/pages/client_admin/packages/add/add.php:88 Stack trace: #0
i am using blue fish in ubunto. even after fixing the double quote, there is no color changes in coding. so the editor is not smart enought to detect errors.
Parsing errors such as missing (or too many) closing quotes or curly-brackets are quite difficult to pin down, how would it know where your close-quote should have been? It can’t presume that the next time it finds a newline should have a quote, nor a semi-colon, there’s literally nothing it can presume, even the closing ?> PHP tag might be in some text. I find it will do the best it can, but no more than that.
All you can do is develop a “nose” for strange error messages and yes, use a text editor that does syntax highlighting. I use notepad++ on Windows, and that does show when a quote is opened but not closed, and will “pair” open and close brackets.
Remember that until you added the correct close-quote, there were no errors in your PHP code after that (as far as the server is concerned) because that wasn’t PHP code, it was quoted text. So none of it was being interpreted or syntax-checked.
Then I suggest choosing a different text editor. Atom is completely free and there’s Sublime Text as well. Though you have to pay for Sublime to remove the annoying purchase alert that pops up every so often.