dimanche 1 octobre 2017

Laravel DB::raw() not executing query but manual execute works

I am running this query

$query = "update my_cloud set full_dir_url = replace(full_dir_url, '$findWhat', '$replaceWith') where full_dir_url like '$findWhat/%' or where full_dir_url = '$findWhat' ";
DB::raw($query);
echo $query;

Output of echo $query is

update my_cloud set full_dir_url = replace(full_dir_url, '/1st Year/Slide', '/1st Year/Slides') where full_dir_url like '/1st Year/Slide/%' or where full_dir_url = '/1st Year/Slide'

When I run this query in phpmyadmin sql editor, data is updated as expected.

But that DB::raw($query) doesn't update any data. No error log either.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire