passing array as parameter to stored procedure in mysql

5 pts.
Tags:
MySQL
MySQL Query Browser
how to passing array as parameter to stored procedure in mysql?

Answer Wiki

Thanks. We'll let you know when a new response is added.

AFAIK that is not allowed in MySql. You can, however, construct a comma separated string and pass it as a varchar.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Reliant
    Use implode() to change your array into a string.
    $array = array('lastname', 'email', 'phone');
    $comma_separated = implode(",", $array);
    
    echo $comma_separated; // lastname,email,phone
    
    Then when you retrieve it from the database use explode().
    $array = explode(",", $string);
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following