mercredi 26 décembre 2018

How to pass table name to the query?

Before I am passing the table name and its alias directly to my query.
$qry = DB::table('tbl_user as u') ->join ......

But now I have to pass the name of table dynamically.

$this->tableName;

I tried as follow

$qry = DB::table($this->tableName + 'as u')

But it didnot work for me.

Any Help please.



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2Smhsij
via IFTTT

Aucun commentaire:

Enregistrer un commentaire