Stored Function returning the function name as the column name

XIAIX's profile image XIAIX posted 10 months ago in Running SQL scripts Permalink

So I created a Stored Function:

Description

And when I run the query, I do indeed get the result "fail" that I was expecting:

Description

However, how to I change the Column Name to "retval" instead of "computer_admin_login`('dummyname', 'dummypassword')"?

This Stored Function is getting called from my PHP code:

Description

which results in:

Description

What I want it to look like is:

Description

XIAIX's profile image XIAIX posted 10 months ago Permalink

Figured it out... just needed to add an "AS":

Description

Description

ansgar's profile image ansgar posted 10 months ago Permalink

If you want numeric arrary keys instead, you may wrap the result of your PHP "query" function:

$dbRecord = array_values($db->query($dbQuery)->getRecord());
XIAIX's profile image XIAIX posted 10 months ago Permalink

If you want numeric arrary keys instead, you may wrap the result of your PHP "query" function:

$dbRecord = array_values($db->query($dbQuery)->getRecord());

Thank, Ansgar... I forgot about the array_values method :)

Please login to leave a reply, or register at first.