-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ID not populating with this SQL select #950
Comments
How do you call that query? |
$query = "SELECT *, i.id
FROM ISSUE i
LEFT JOIN REMOTEID r
ON i.id = r.issue_id
AND r.service_name = '$serviceName'
WHERE r.issue_id IS NULL
AND i.publication_id = $pubId
LIMIT $numberOfFilesToUpload";
$rows = R::getAll($query);
$issuesToUpload = R::convertToBeans('issue', $rows); |
Both tables have an |
Moreover (I have not tested this and haven't written any Redbean code in a while) you might be able to achieve the result you want directly using: $issuesToUpload = R::find(
'issue',
' SELECT i.*
FROM issue i
LEFT JOIN remoteid r
ON i.id = r.issue_id AND r.service_name = ?
WHERE r.issue_id IS NULL
AND i.publication_id = ?
LIMIT ? ',
[ $serviceName, $pubId, $numberOfFilesToUpload ]); |
With this sql select I'm getting behavior I didn't expect:
Output is:
I would expect id to be populated. When I modify the sql this way, it works:
Output is:
Is this expected behavior? When I run the first query through MySQL directly rather than through RedBean it works as I expect.
The text was updated successfully, but these errors were encountered: