2

I have MySQL procedure where I want to get a result of query:

SELECT id FROM mbus_clients WHERE second_name like surnamePart AS

So it should be an array. The decision I've found in the internet is to use temporary table. But how can I return a table and read with PHP? Is it ok?

1 Answer 1

2

Simply call the procedure:

CALL procedurename();

If the procedure performs a SELECT, the result set of the procedure call will be the same as if you'd performed the query itself. You can then fetch the rows using PHP the same way as if you'd performed a SELECT.

Sign up to request clarification or add additional context in comments.

2 Comments

But i should use the first element of this array in procedure. Actually it should return two output variables and both should be array. Is it possible?
There's no such thing as arrays in MySQL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.