Skip to content
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

Prevent warning if we don't have Select #32

Open
ma0dubois opened this issue Feb 17, 2020 · 0 comments
Open

Prevent warning if we don't have Select #32

ma0dubois opened this issue Feb 17, 2020 · 0 comments

Comments

@ma0dubois
Copy link

Hi guys,

In this part of code:

foreach ($select as $clause) {

I've added this precaution:

#search to see if the expression matches an alias
if (is_array($select)) {
    foreach ($select as $clause) {
        if (!$clause['alias']) {
            continue;
        }
        if ($clause['alias']['name'] === $parseInfo['expr']) {
            $parseInfo['type'] = 'alias';
        }
    }
}

Because, when i don't have a select clause in my sql request, i had this warning:
Warning: Invalid argument supplied for foreach() ... on line 1321

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant