473,395 Members | 1,677 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,395 software developers and data experts.

to write an arrau to a table

Hi at all

I have a javascript array to pass to PHP:
var
javascript_array={{"1","Elisabeth","London"},{"2", "Antony","Paris"},{"3","Augusto","Roma"},{"4","Tom ","Miami"}}

I transform it into a string

var string="1,Elisabeth,London;2,Antony,Paris;3,August o,Rome;4,Tom,Miami"
I separated any old array with a ";" and any element of a singhe array with
","

Now I pass to php the string throught a form as an hidden field.

In this case the old array had 4 arrays into each with 3 elements but can
have more array into any with 3 elements (id,name,city)
Now I must save any array into a mysql table having 3 fields therefore in
this case I'll write 3 new records

My PHP Version is 4.4.7.

How can I do please?

Thank you very mich

S.G.
Nov 17 '07 #1
1 1061
Stop & Go wrote:
array={{"1","Elisabeth","London"},{"2","Antony","P aris"},{"3","Augusto","Roma"},{"4","Tom","Miami"}}

I transform it into a string
var string="1,Elisabeth,London;2,Antony,Paris;3,August o,Rome;4,Tom,Miami"
I separated any old array with a ";" and any element of a singhe array with
","
And the format of the JS-Array never changes? so you can do it.
Now I pass to php the string throught a form as an hidden field.

Now I must save any array into a mysql table having 3 fields therefore in
this case I'll write 3 new records

My PHP Version is 4.4.7.

How can I do please?
- explode the string by ';' separator
- iterate the resulting array
- explode each element of this by ','
- write data into your table

where is the problem?

First you have to learn some PHP-Basics.

So long, Ulf

--
_,
_(_p Ulf [Kado] Kadner
\<_)
^^
Nov 17 '07 #2

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

Similar topics

1
by: Bob Murdoch | last post by:
I have a situation where I call a COM object from ASP that is supposed to create a file. On occasion, especially during development, the output of the COM function is an error string rather than...
2
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of...
8
by: Ben | last post by:
Hi all, Just wondering how to write (using document.write) to a table cell. I have table with 3 rows and 3 colums. I want to write from within the Javascript to say third column of a first row....
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
1
by: Dan | last post by:
Hi I've created a generic 'Report' class that takes a DataView from a DataGrid control and writes it out to the response as a csv file for download. Basically, when a user clicks the download...
4
by: crystal | last post by:
I've checked the threads but haven't been able to come up with a solution to my issue. Help...... I have a simple form based on a table. Within the form is a subform that is also, through a Q,...
1
by: insist | last post by:
I with response.write("table=...") to draw the first table,and respons.write("<br>"),and then with response.write("table...") to draw the two table,but the two table display in the middle of the...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
6
by: globalrev | last post by:
i ahve a program that takes certain textsnippets out of one file and inserts them into another. problem is it jsut overwrites the first riow every time. i want to insert every new piece of...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
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...

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.