is there a built-in method or method for implementing the method mysqli_real_escape_string. I have some user data on which I have to implement this method.
I tried this method \DB::escape()in laravel but got the following error.
Error Exception in DatabaseManager.php 296 line: call_user_func_array ()
expects parameter 1 to be a valid callback; class "Illuminate \ Database \ MySqlConnection" does not have an escape method
while If I try to manually implement this method, I mysqli_real_escape_stringreceived the following error.
Error in Contact.php line 348: mysqli_real_escape_string () expects exactly 2 parameters, 1 given
I did some R&D, for this method mysqli_real_escape_string()I need to pass 2 parameters 1, this is a connection to a DB connection, and 2nd is a string to implement the action of the method. but now, How do I find out the link to the Laravel DB connection?
any idea or solution for this?
source
share