Hi all.
I have this values: - R, S, T, G
-
1, 2, 3, 4
-
1, 2, 3, 4
-
1, 2, 3, 4
-
1, 2, 3, 4
-
1, 2, 3, 4
-
P, N, P, N
-
BF, CC, BF, CC
I need insert this values in the table of db mysql in this mode: -
TEST A B C D E F
-
-
R 1 1 1 1 P BF
-
S 2 2 2 2 N CC
-
T 3 3 3 3 P BF
-
G 4 4 4 4 N CC
-
Can you help me?
thanks
5 1301
Hi viki,
What is it exactly that you don't know how to do? Do you know how to insert data into a MySQL database? Or is it converting the data into the required format to insert it that's causing you problems?
How are you receiving this data e.g. XML File, text file, form submission etc.
Dr B
Hi Dr. , thanks x your answer.
The code ASP this is: -
-
response.write trim(request.form("fase")) &"<br>" &_
-
trim(request.form("V_prova")) &"<br>" &_
-
trim(request.form("I_prova")) &"<br>" &_
-
trim(request.form("V_scarica")) &"<br>" &_
-
trim(request.form("durata")) &"<br>" &_
-
trim(request.form("V_applicata")) &"<br>" &_
-
trim(request.form("esito")) &"<br>" &_
-
trim(request.form("modalita")) &"<br><br>"
-
-
ReDim arrayForm(1, 255)
-
intIndice = 0
-
-
For Each varItem in Request.Form
-
If Request.Form(varItem).count > 1 Then
-
-
For intLoop = 1 to Request.Form(varItem).count
-
-
arrayForm(0, intIndice) = varItem & "(" & intLoop & ")"
-
arrayForm(1, intIndice) = Request.Form(varItem)(intLoop)
-
intIndice = intIndice + 1
-
Next
-
Else
-
-
arrayForm(0, intIndice) = varItem
-
arrayForm(1, intIndice) = Request.Form(varItem)
-
intIndice = intIndice + 1
-
End If
-
Next
-
-
ReDim Preserve arrayForm(1, intIndice - 1)
-
-
For intIndice = 0 To UBound(arrayForm, 2)
-
Response.Write arrayForm(0, intIndice) & " = " _
-
& arrayForm(1, intIndice) & "<BR>"
-
-
strSQL = "INSERT INTO "
-
strSQL = strSQL & " tbl_2 "
-
strSQL = strSQL & " ( "
-
strSQL = strSQL & " PROVA, "
-
strSQL = strSQL & " A, "
-
strSQL = strSQL & " B, "
-
strSQL = strSQL & " C, "
-
strSQL = strSQL & " D, "
-
strSQL = strSQL & " E, "
-
strSQL = strSQL & " F "
-
strSQL = strSQL & " ) "
-
strSQL = strSQL & " VALUES "
-
strSQL = strSQL & " ( "
-
strSQL = strSQL & " '" & arrayForm1(i) & "', "
-
strSQL = strSQL & " " & arrayForm2(i) & ", "
-
strSQL = strSQL & " " & arrayForm3(i) & ", "
-
strSQL = strSQL & " " & arrayForm4(i) & ", "
-
strSQL = strSQL & " " & arrayForm5(i) & ", "
-
strSQL = strSQL & " '" & arrayForm6(i) & "', "
-
strSQL = strSQL & " '" & arrayForm7(i) & "' "
-
strSQL = strSQL & " ) "
-
cn.execute(strSQL)
-
-
Next
-
-
The error in the query is:
Error Type:
Error run-time Microsoft VBScript (0x800A0009)
Why?
Your array is out of range. Which line is it erroring on?
Hi Dr.
My problem is this.
I have this values of request.form:
I see this values for column and insert in the db mysql in this mode: -
-
INSERT INTO MyTbl ( Text, Number ) VALUES ( 'A', 1 )
-
INSERT INTO MyTbl ( Text, Number ) VALUES ( 'B', 5 )
-
INSERT INTO MyTbl ( Text, Number ) VALUES ( 'C', 9 )
-
-
Do you understand my?
All ok people!!!!
The solution is: - INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
Property of db mysql: http://dev.mysql.com/doc/refman/5.0/en/insert.html Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bob Bedford |
last post by:
I've a table on mysql:
code1 tinyint, code2 tinyint, notcode1 varchar(20),notcode2
varchar(20),label
I do have some records:
values(1,null,null,null,'text1');...
|
by: Philip Hachey |
last post by:
I think this is do-able, and possibly even simple, but it's been too
many years since I've done anything significant with SQL. Any help
would be appreciated.
I have two tables, PAY and CHG. ...
|
by: Spark |
last post by:
Hi,
Situation:
Need a query to return number of ticket records by month of open in a
log table where the ticket open record is older than 24 hours then the
ticket pending or ticket closed...
|
by: Myron |
last post by:
I'm trying to create a query that will tell me which requests
took longer than 10 days to move one from particular state to another
state. The query I've created returns the correct requests,
but...
|
by: KoliPoki |
last post by:
Greetings.
I'm having a little trouble with a query. The idea is simple I need to
display a list of recently unique visited URLs and the last time I
visited.
I have 2 table one stores the...
|
by: kjaggi |
last post by:
-- tested schema below --
-- create tables --
create table tbl_test
(serialnumber char(12))
go
create table tbl_test2
(serialnumber char(12),
exportedflag int)
go
--insert data --
|
by: KoliPoki |
last post by:
Hello every body.
I have a small issue.
Problem: I have a table with 4 descriptor columns (type). I need to
formulate a query to retrieve a count for each type so I can group
by...etc. The...
|
by: phlype.johnson |
last post by:
I'm struggling to find the best query from performance point of view
and readability for a normalized DB design.
To illustrate better my question on whether normalized designs lead to
more complex...
|
by: Jennifer |
last post by:
I have a table that I am trying to do a query on.
Table is named GPFCount2.
CREATE TABLE (
NULL ,
NULL ,
NULL ,
NULL ,
NULL ,
|
by: Dinesh |
last post by:
Hi experts,
I am working on SQL Server 2005.
Now i have to write a query which will extract some information from a
table.
My main table is having few columns supose 3 columns.
EmpID ...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |