Reputation: 2384
I am using laravel to get data from my database where i required to get the instruction with single quote Means wants to replace double quote with single quote wherever the double quote is used. I am new to laravel, i know query structure of MySql and understanding laravel so any suggestion will be helpful for me.
Edited
An example of MySql Query is as below, I wants something like this in laravel
select replace(col_instruction,'"',"'") from mytable
Upvotes: 2
Views: 2742
Reputation: 163768
According to the documentation, this should work:
$result = DB::table('mytable')->select(DB::raw('replace(col_instruction, \'"\',"\'")'))->get();
Upvotes: 4