decibel
07-06-2010, 12:46 PM
hi, i'm new to asp, long time php dev, i have this code which is giving me an array from a sql query, but I need to restructure my 'records' array like the sample array below:
'objDB already created
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM games", objDB
'Now, read the Recordset into a 2d array
Dim records
records = objRS.GetRows()
this is what i get:
Array
(
[0] => Array
(
[0] => 1
[1] => 2
)
[1] => Array
(
[0] => Bill Wall
[1] => Jill Hall
)
[2] => Array
(
[0] => 1975-01-09
[1] => 1974-04-23
)
)
this is how i need the array to be structured:
Array
(
[0] => Array
(
[0] => 1
[1] => Bill Wall
[2] => 1975-01-09
)
[1] => Array
(
[0] => 2
[1] => Jill Hall
[2] => 1974-04-23
)
)
Any help would be greatly appreciated, thanks.
'objDB already created
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM games", objDB
'Now, read the Recordset into a 2d array
Dim records
records = objRS.GetRows()
this is what i get:
Array
(
[0] => Array
(
[0] => 1
[1] => 2
)
[1] => Array
(
[0] => Bill Wall
[1] => Jill Hall
)
[2] => Array
(
[0] => 1975-01-09
[1] => 1974-04-23
)
)
this is how i need the array to be structured:
Array
(
[0] => Array
(
[0] => 1
[1] => Bill Wall
[2] => 1975-01-09
)
[1] => Array
(
[0] => 2
[1] => Jill Hall
[2] => 1974-04-23
)
)
Any help would be greatly appreciated, thanks.