This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
SQL column alias bug #317
Comments
I have no luck to reproduce that error on my local env) Could you please add more information, may be table structure or scope code ?) |
you should can do something like this: use Zend\Db\Sql\Predicate\Expression;
$select->join(
'vendors',
'vendors.id = campaigns_vendors.vendor_id',
[
'vendor_id' => new Expression('vendors.id'),
'vendor_daily_limit' => new Expression('vendors.daily_limit'),
],
$select::JOIN_LEFT
); |
It turns out I was looking at the wrong code. Sorry for wasting your time. |
This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at laminas/laminas-db#51. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
....$select...->join('vendors', 'vendors.id = campaigns_vendors.vendor_id', ['vendor_id'=>'id', 'vendor_daily_limit'=>'daily_limit'], $select::JOIN_LEFT)
When I query this select object I get the following error: "Not a valid magic property for this object"
When I rename the column alias to anything else but 'vendor_daily_limit' the error goes away.
When I print the produced SQL and run it via phpMyadmin or Bench then the query executes perfectly.
Very bizarre error and no indication of what is causing it.
The text was updated successfully, but these errors were encountered: