Closed lianghsun closed 7 years ago
All you can do with standard Eloquent, you, in theory could do with laravel-sybase, the package works as a translator. This translation works directly in the query (and Builder) provided by Eloquent, such as a parser. If there was any problem of that kind, it probably was in the assembly (or by your mistake, or by mistake of the package). Can you transcribe the errors?
OK, it's wired. The code is as below:
$lists = Filght::where([['flight_name', '=', 'aaa'], ['no', '=', '0163']])->get();
then, the erros is:
QueryException in Connection.php line 769:
Undefined variable: new_binds (SQL: select * from [flights] where ([flight_name] = aaa and [no] = 0163))
any solution?
i'll check!
did you tried it using orWhere ?
and the Code will be like this :
$lists = Filght::where('flight_name', '=', 'aaa') ->orWhere('no', '=', '0163') ->get();
This will work, however, it needs to be fixed this implementation of Laravel 5.3.
@galangnra It works, and the code like this works too :
$lists = Filght::where('flight_name', '=', 'aaa')->Where('no', '=', '0163') ->get();
but, what i want is to dynamically get user's input to generate where sql statement, that is why i want to define an array could store multiple where clauses, like:
$stat = [
['column_1', '=', 'value_1'],
['column_2', '<>', 'value_2'],
[COLUMN, OPERATOR, VALUE],
...
]
This should work, but I'll do some more testing.
Hi, thanks for such convenient package. I have a question, could we use multiple where clause? In Laravel doc, we can
But when I tried to do the same thing, it came out the error. Please correct me if I have wrong using, thanks!