-->where ...where exactly?

-->where ...where exactly?

mooomooo Posts: 4Questions: 0Answers: 0
edited September 2013 in Editor
Hi Allan,.. hi fellow DataTables users

I used the generator on the Editor website to generate a scaffold for my crud table.
Now i need to limit the result set of the table to show only the rows
e.g.: "where owner = '$logged_in_user'" ..
I did some research in the Forum and some people are using a -->where function which
somehow places a where in the sql string.
Could somebody please shed light on where (in which file?) this:
(snippet found in query.php)

$query
->where( 'name', 'allan' )
->where( function ($q) {
$q->where( 'location', 'Scotland' );
$q->where( 'location', 'Canada' );
} );

can be inserted? it looks like PHP ..
Thanks in advance
Martin

Replies

  • allanallan Posts: 63,532Questions: 1Answers: 10,475 Site admin
    It is indeed in the PHP. If you look in the files that Generator created, you'll find `table.{myTable}.php` which is the server-side file that Generator created for interaction with the client-side. It is in the Editor instance there that you would add your `where()` call.

    Regards,
    Allan
  • mooomooo Posts: 4Questions: 0Answers: 0
    Thanks..
    works perfectly..
This discussion has been closed.