Forum Moderators: open

Message Too Old, No Replies

Asp array

         

stevelibby

1:17 pm on Apr 30, 2007 (gmt 0)

10+ Year Member



hope you guys can help me here, i am trying to create a array with make and model so that it will look like this :
var MAKES = new Array('Select a Make','AC','AIXAM','ALFA ROMEO','AUDI','AUSTIN','BENTLEY','BMW','BRISTOL','BUICK','CADILLAC','CATERHAM');

var MODELS = new Array(
new Array('Any'),
new Array('ACE','COBRA','SUPERBLOWER',''),
new Array('500','500.5','MAC 500',''),
new Array('145','146','147','155','156','164','166','33','75','ALFASUD','GT','GTV','RZ','SPIDER','SPORTWAGON','SZ',''),

The make part i have manged to do, but i cant cant get my head around the model part any ideas?

DWarp9

1:49 pm on Apr 30, 2007 (gmt 0)

10+ Year Member



Are you sure you meant to post in the ASP forum? Your syntax is php, perhaps someone in that forum will be better suited to help you.

I don't know how to define two-dimensional arrays in php, but in asp the simplest syntax would be:

Dim models(3, 15)
models(0,0) = 'any'
.
.
.

Come to think of it, the problem may be due to the fact the the resulting matrix (2d array) won't be square.

Hope this helps.
-Peter

stevelibby

1:52 pm on Apr 30, 2007 (gmt 0)

10+ Year Member



hi, its the way the js script is put together i had the idea that i could create the array then hard code it and save it to a file then i could reduce the sql db payload.

stevelibby

9:00 am on May 2, 2007 (gmt 0)

10+ Year Member



Hi just to let you know that i solved this issue by Creating a query string that put all makes into a array and then created a new bd string where each make was entered into the string, works a treat :-)