This question already has answers here:
CodeIgniter - how to catch DB errors?
(12 answers)
Closed 8 months ago.
I have an Codeigniter app (using version 2.1.0) that is writing a transaction to a mysql database. I'm fairly sure that I've got a foreign key constraint error occurring, but I can find no way to make CI tell me the specific error. mysql_error() comes back empty.
Can anyone tell me how to get Codeigniter to tell me the mysql error message?
Yes, this is the mysql_error() wrapper.
$this->db->_error_message();
And the mysql_errno wrapper is:
$this->db->_error_number();
You may be able to use call_function in the db class to access mysql_error:
http://ellislab.com/codeigniter/user-guide/database/call_function.html
Of course, you could also just turn on the debug flag in the DB config, to tell CI to display db errors:
http://ellislab.com/codeigniter/user-guide/database/configuration.html
db_debug - TRUE/FALSE (boolean) -
Whether database errors should be
displayed.
Related
In Laravel, why do I use assertSessionHasErrors() in order to check if there was an error?
I used this in my feature testing to make sure there is a validation error and it worked, but I don't get why an error is in a session even though I haven't added anything to the session. Do errors go into the session of a response? Can anyone explain this?
According Lavavel doc:
https://laravel.com/docs/8.x/validation#quick-displaying-the-validation-errors
In addition, all of the validation errors and request input will automatically be flashed to the session.
I am using laravel 5.5. * And I'm testing with vega scanner and getting SQL injection error.
How to fix this problem.?
this is the complete error specification
From my understanding, you are inserting directly in the database whatever comes from your request parameters, as the error says it is an "input validation error".
This is happening because you are not validating those inputs, in Laravel you can create validators, so that whenever you want to insert something, the values from the request are validated. If they are not validated, you can return a different response or prevent the controller from inserting data.
Here is the official documentation of Laravel, and it is really well explained. (I have browsed for your version, even though you can check the documentation for the latest version).
Hope I was able to help you.
I deployed my Laravel application to my web hosting site. Everything transferred successfully, but every time I login I get some message about parse syntax unexpected ? but its not telling me where its coming from this happens also on my other pages.
I'm using PHP 7.0 on my hosting site and Laravel 5.4. it will mean so much if you can help me understand what is going on. I can't provide you with a code because I don't know where the error is coming from. It doesn't tell me what line or anything. Please do not tell me the solution is in this similar question where it says "parse error" duplicate because I tried that and nothing happened
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
The question marks are a feature of php 7.1. As you have said in the comments, the version on the server is only 7.0.
see http://php.net/manual/en/migration71.new-features.php for more information about this feature.
I've the following problem:
I have an Oracle forms Application where the User can call multiple Forms.
I also have an Menu with an Logout button, that should close all open Forms.
When this button is pressed I set :GLOBAL.LOGOFF to 'TRUE'. And in WHEN_WINDOW_ACTIVATED I have placed the following code.
DEFAULT_VALUE('FALSE','GLOBAL.LOGOFF');
IF (:GLOBAL.LOGOFF = 'TRUE') THEN
COMMIT;
DO_KEY('EXIT_FORM');
END IF;
This whole thing also works when the Oracle Forms Application is called from a browser.
But when I call it via JNLP it crashes the application. I get the following errors:
FRM-40735: WHEN-FORM-NAVIGATE
FRM-40735: WHEN-NEW-ITEM-INSTANCE
FRM-40735: WHEN-WINDOW-DEACTIVATED
All with:
ORA-06508
I don't understand how the Forms Application is reacting differently depending on if it is executed via JNLP or from a Browser.
Although I question why you are doing logoff handling in a WHEN_WINDOW_ACTIVATED trigger, it is possible what you are seeing is related to a known issue. Refer to these Oracle bugs that all map together. You may need to work with Oracle Support as some of the bugs and/or their content may not be visible to you. 9764631, 22724515, 26996652
Also, if you are not already using 12.2.1.3, you will need to update your version in order to get the fix I mentioned.
Helpful resource:
https://community.oracle.com/community/development_tools/forms
i already posted this question but still wasnt able to resolve this issue.
seems that everyone has this problem with codeigniter .
When i set my session in a controller it works perfectly and i can display it.
WHen i move to another controller, the (CUSTOM) session data is completely lost.
i tried changing my cookie_domain in config.php. Since i am on localhost i tried localhost with without / and localhost/codeigniter and sodeigniter all did not work. i am lost
btw, i read somewhere that this happens when 2 ajax requests happen at the same time. could that be the problem?
Or maybe tell me how you resolved the problem if you had same issues
screw this, i am swithing to php native sessions. if anyone wants to do that,
http://codeigniter.com/wiki/PHPSession
Check and double-check your code or any external libraries you are using for a stray sess_destroy(). I ran into a similar problem where I was storing an id in the session for reference but if the user then logs in the SimpleLogin library I was using for logins just destroys the entire session including data I did not want to lose.
This is what I get for not writing my own code.