473,378 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to store an array in the MySQL?

Hi,

I would like to be able to store numerical array in MySQL. I am really
looking for the solution to store it in the one field only.

For example, I have a matrix, which I want to store in the table, but
I don't want to create one column per matrix element - too many
columns or matrix size could change easily.

Should I convert all elements from numerical type into string and
create one long string with element separators or it is better to
serialize the whole array and write it as a byte array? What other
options are available?

I know Oracle allows to store the array directly in the DB. How MySQL
approaches this problem?

Thank you,

Jacob Nikom
Jul 19 '05 #1
3 8554
blob fields.

bobb
"jacob nikom" <ja*********@ieee.org> wrote in message
news:6e*************************@posting.google.co m...
Hi,

I would like to be able to store numerical array in MySQL. I am really
looking for the solution to store it in the one field only.

For example, I have a matrix, which I want to store in the table, but
I don't want to create one column per matrix element - too many
columns or matrix size could change easily.

Should I convert all elements from numerical type into string and
create one long string with element separators or it is better to
serialize the whole array and write it as a byte array? What other
options are available?

I know Oracle allows to store the array directly in the DB. How MySQL
approaches this problem?

Thank you,

Jacob Nikom

Jul 19 '05 #2
blob fields.

bobb
"jacob nikom" <ja*********@ieee.org> wrote in message
news:6e*************************@posting.google.co m...
Hi,

I would like to be able to store numerical array in MySQL. I am really
looking for the solution to store it in the one field only.

For example, I have a matrix, which I want to store in the table, but
I don't want to create one column per matrix element - too many
columns or matrix size could change easily.

Should I convert all elements from numerical type into string and
create one long string with element separators or it is better to
serialize the whole array and write it as a byte array? What other
options are available?

I know Oracle allows to store the array directly in the DB. How MySQL
approaches this problem?

Thank you,

Jacob Nikom

Jul 19 '05 #3
blob fields.

bobb
"jacob nikom" <ja*********@ieee.org> wrote in message
news:6e*************************@posting.google.co m...
Hi,

I would like to be able to store numerical array in MySQL. I am really
looking for the solution to store it in the one field only.

For example, I have a matrix, which I want to store in the table, but
I don't want to create one column per matrix element - too many
columns or matrix size could change easily.

Should I convert all elements from numerical type into string and
create one long string with element separators or it is better to
serialize the whole array and write it as a byte array? What other
options are available?

I know Oracle allows to store the array directly in the DB. How MySQL
approaches this problem?

Thank you,

Jacob Nikom

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Donald Tyler | last post by:
Yes it can. But you should understand the three distinct levels of that situation. You need the following: Database Web Server Server-Side Scripting Language I would suggest using AMP...
12
by: jacob nikom | last post by:
Hi, I would like to store XML files in MySQL. What is the best solution: 1. Convert it to string and store it as CLOB/text 2. Serialize it and store as byte array 3. Flatten it out and create...
3
by: YAN | last post by:
my database (mysql) would be used to store Simplified Chinese and Traditional Chinese, so i would like to store the text as unicode to the database. I know there is a function...
0
by: Gert | last post by:
Hi, I need to store a array() of byte to a mysql field. I created a field in mysql of type varbinary. But storing and retrieving gives problems. Please help. The strTemp = EnDeCrypt(txt,...
5
by: lawrence k | last post by:
I'm a little weak on my basic I/O. Help me out please. Is it right to say that I can just open any file with file(), get it as a string, and then store in a MySql database, in, say, a MediumText...
3
by: JM | last post by:
Before storing information from a form in database I perform follwing operations on it : $path = mysql_real_escape_string(strip_tags(trim(urldecode($_POST)))); $summary =...
9
by: Ajinkya | last post by:
Hello friends ! , I am very new to java script.If anyone can help me then I will be very very thankful to his/her. I am using php and mysql in my project and I have one textarea and one...
0
bilibytes
by: bilibytes | last post by:
Hi, i am trying to figure out how to store a friend relation beetween my users. 1. I thought about using arrays, store for each user an array containing all its friends. But i don't know if...
70
mideastgirl
by: mideastgirl | last post by:
I have recently been working on a website for an honors association, and have a lot of difficulty but have found help from those on this site. I would like to see if I can get some more help on a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.