mercredi 1 février 2017

Laravel 4.2 execute query without using elequent query builder

I have a query with sub-query .. and i want to write an explicite SQL request and execute it Query :

select count(*) as count from 
(
SELECT DISTINCT t.article_id FROM 
`articles` as a left join `tags` as t
on a.`id` = t.`article_id`
where a.`flag` = 1
) as sub

i tried this to execute the request without building the query :

DB::connection()->getPdo()->exec( $sql );

But it always return 0 !



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2jvLMK0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire