Skip to content

dbObject: order by error "unknown column d", but column "id" was requested #896

Open
@jeanmonet

Description

@jeanmonet

Fatal error: Uncaught Exception: Unknown column 'd' in 'order clause' query: SELECT * FROM last_obj ORDER BY d DESC LIMIT 1 in /MysqliDb.php:1996 Stack trace: #0 /MysqliDb.php(1584): MysqliDb->_prepareQuery() #1 /MysqliDb.php(734): MysqliDb->_buildQuery(1) #2 /MysqliDb.php(760): MysqliDb->get('last_obj', 1, '*') #3 /dbObject.php(360): MysqliDb->getOne('last_obj', NULL) #4 /dbObject.php(548)

The error was triggered by:

last_obj::orderBy("id", "desc")->getOne();

The error seems to appear from time to time: in two subsequent requests, one may fail, the other may succeed.

Any ideas on why this happens?

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