jeudi 7 novembre 2019

Laravel count raw query always return zero

I am working with multiple databases in single project. When I run simple raw query to get another database table count but it always return zero instead of actual counts. Even I have more than 1 million records in table.

I run raw query in following formats but result is zero

$dbconn = \DB::connection("archive_db");
$dbconn->table('activities_archived')->count() 

$sql = "SELECT COUNT(*) as total FROM activities_archived";
$result = \DB::connection("archive_db")->select(\DB::raw($sql));

Event I have set the database connections strict option to false but still facing same issue.

Now I am totaly stuck that why this issue is coming



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire