473,799 Members | 3,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8585
blob fields.

bobb
"jacob nikom" <ja*********@ie ee.org> wrote in message
news:6e******** *************** **@posting.goog le.com...
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*********@ie ee.org> wrote in message
news:6e******** *************** **@posting.goog le.com...
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*********@ie ee.org> wrote in message
news:6e******** *************** **@posting.goog le.com...
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
1969
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 (Apache, MySQL & PHP). If you want to know more
12
7725
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 one column per element, each column is VARCHAR Does MySQL has anything special for XML data? Is there any software which helps to store XML data in MySQL
3
1958
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 Encoding.Unicode.getByte, and i would like to use in this way: Dim source As Byte() = System.Text.Encoding.Unicode.GetBytes("中国") After i get the Byte Array, how can i store the array by INSERT SQL statement?
0
1463
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, psw)
5
3375
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 field? I realize that MySql supports binary fields, but my current MySql schema does not have any binary fields, and I'm wondering if I can store the file without changing my current schema. Can I recreate the file later, if I wish, just be...
3
3627
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 = mysql_real_escape_string(strip_tags(trim(urldecode($_POST)))) When I look in database I see '\r\n' in the text for the summary wherever I pressed return-key. When i retrieve the information from database and display it on webpage
9
19848
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 list boxes,now whenever user fill any value(email-Id) to textarea and press submit button then value going to listbox. These values are one or multiple , then they goes into list box , In list box these values are store in array . I mean user...
0
2616
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 arrays are suported in MySQL: -> if they weren't i could also do a string which is the result of friends concatenation. But maybe it would be to much work to explode and implode the content at each time a user wants to get a list of its friends. ...
70
5409
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 different issue than what I was initially having. I am working on storing data collected from a form on my website. I would like the information to be stored into MySQL once entered by users. I have googled this question and have tried multiple...
0
10249
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10219
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10025
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7563
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6804
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.