Skip to content

Prevent warning if we don't have Select #32

@ma0dubois

Description

@ma0dubois

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions