php - Can you use query builder to build a query with a dynamic WHERE clause at runtime in laravel3? -


i know in laravel 4 can create dynamic clause @ runtime following question:

can use query builder build query dynamic clause @ runtime in laravel?

but can same in laravel 3?

if not, option instead create raw sql code in following:

$sql = "select * " . $table;  $first = 1; foreach($items $key => $val) {    if($first) $sql .= " ";        else $sql .= " , ";    $sql .= $key . " " . $val;    $first = 0; } 

it works pretty exact same way. use $query = db::table('tablename'); in place of first line in related post use rest of example shows.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -