Hi there,
can you please help me?
i have data in array and i want to insert it in a single table.
structure of table and array to be store is shown below:
Please let me know how to store this array in database? Database Structure: array-structure database-Browse
Let me know any solution for this?
Thanks in anticipation
5 4649
Make a different table for temp_property, with primary key as (temp_id, temp_property_id) using foreign key (temp_id) with fields (name, add, size, price, detail)
If there's no unique id for every property, then make one.
Thanks for your reply but i did this in another way using serialize and unserialize
Solution: -
//sample
-
$temp1 = serialize ($exarray);
-
and then store $temp1 in batabase field.
-
(recommend to keep datatype of that field as text)
-
-
While fetching the data, again make it unserialize
-
and you will get your original array
-
Like this
-
$exarray = unserialize ($temp1);
-
thanks again for your time
If each property has its own name, ad, size, price & detail (as I suppose), I'd still recommend you to make a different table. You will find it useful later on.
serialize() and unserialize() are in the language primarily for session handling, so that you can save the $_SESSION array. This can be saved in the database since the $_SESSION array should not be limited in the types of fields that it can have.
However, for pretty much everything else, this is not the case. Session data is like file data. But, data that has specific properties should be inputted in the database with each property as it's own column and each instance as its own row.
Otherwise, what is the point of even having columns in database tables?
I would like to say Thanks to all of you for this great discussion.
Your replied posts are really very appreciating.
I think we need to close our discussion here.
Thanks again
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Charles Banas |
last post by:
i've got an interesting peice of code i'm maintaining, and i'd like to
get some opinions and comments on it, hopefully so i can gain some
sort of insight as to why this works.
at the top of the...
|
by: Mark Smith |
last post by:
I'm trying to copy data from a 1D array to a 2D array.
The obvious thing doesn't work:
int twoDee = new int;
int oneDee = new int { 1, 2 };
Array.Copy(oneDee, 2, twoDee, 2, 2);
This causes a...
|
by: chris |
last post by:
Hi there,
I created a Multidimensional array of labels
Label lblMultiArray = new Label { {Label3, LblThuTotal},
{Label4,LblFriTotal} };
Now I would like to compare the values in the array,...
|
by: BobbyS |
last post by:
I am trying to develop a multidimensional array for use of searching a very
large database. I understand the concept of one and two dimensional arrays
but this project would include up to 12 or 13...
|
by: BB |
last post by:
Hello,
I have a HTML form containing multidimensional selects listing
equipments and their quantitites. This allow the users to select the
kind of equipment and quantitites they would like to...
|
by: luftikus143 |
last post by:
Hi there,
I need to store three pieces of data - a result of a SQL query - in a multidimensional array, but don't really succeed. Sometimes it works, but then the output doesn't work accordingly....
|
by: JackpipE |
last post by:
I need to create multidimensional array with arrays inside of it.
database
name | value1 | value2
john | red | 45
john | red | 56
john | yellow | 11
mike | blue | 23
mike | black | 41
|
by: LittleCake |
last post by:
Hi All,
I have a multidimensional array where each sub-array contains just two
entries, which indicates a relationship between those two entries. for
example the first sub-array:
=Array
(
=30...
|
by: Slain |
last post by:
I need to convert a an array to a multidimensional one. Since I need
to wrok with existing code, I need to modify a declaration which looks
like this
In the .h file
int *x;
in a initialize...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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,...
| |