Open broodstare opened 7 years ago
I really appreciate your use and feedback! Apparently the package is not adding the fields to the variable that identifies the types. I'll check and in the next few hours I'll give you a position!
Deeply thanks! @mainginski :D
How do you define your table in the model?
Sorry for replying so late. I have another stuff bother me two weeks ago. And now i finally have time to face this problem again.
I define my model SoftwareList.php
as following:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SoftwareList extends Model
{
protected $connection = "sybase";
protected $table = "my.software";
}
then, I try php artisan tinker
in console, and type the following:
>>> SoftwareList::where('soft_name', 'Mac OSX')->get()
and the console shows that:
Illuminate\Database\QueryException with message 'PHP error:
Undefined variable: tipos in /var/www/html/software-management/vendor/uepg/laravel-sybase/Database/SybaseConnection.php
on line 140 (SQL: select * from [my].[software] where [soft_name] = Mac OSX)'
thanks for helping, and sorry i'm so late to reply.
I am going on vacation for two weeks, however, I imagine your problem is because you are putting your username in $table
, laravel-sybase does NOT support this yet, only database..table
or table
, while your attempt was user.table
. If it is not possible to hide the user, you will have to do the encoding, or wait for my return.
A feedback?
No, i use query builder instead of ORM, e.g.
$user = DB::connection('sybase')->table('table_name')->where('username', $username)->get();
But, i really hope to use ORM, it can save many time and distinguish different business models.
I just remove username
before the table
, e.g.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SoftwareList extends Model
{
protected $connection = "sybase";
protected $table = "software"; // <--- change here
}
After that, it works.
Ok, thank you for giving a comeback. The problem does exist even though it is bypassed.
Hi, thanks for this great package, but I have a little problem here. When I try to use conditional clauses, like:
$list->where('disk_qty', 0)->get()
, it shows error messageThe type of the column
disk_qty
isint
, how should I fix this problem? Thanks.