tags:

views:

17

answers:

2

How to store data in array in mysql function or procedure? How to initialize array in mysql? array like

array(1=>1,b=>2) is it possible in mysql?

A: 

You can not declare a array in mySQL. In SQL an array is called a table :-).

Manjoor
Any documentation for reference??
Mithun P
if you mean mySQL refrence the check http://dev.mysql.com/doc/refman/5.1/en/data-types.htmlYou can't find array refrence because it is not in mySQL. You can use a temporary table for same purpose.
Manjoor
A: 

You are able to store an PHP array in MySQL using the functions serialize() and unserialize(). serialize() converts any data including arrays to a string which can be converted back to the original value using unserialize().

I'm sure there are similar possibilities and methods in other languages.

The only con is that you aren't able to parse it and search through it with pure SQL.

rami