I am using an array to get the column names from a table and I am using Getrows to populate it from a MYSQL recordset. Like this:
arrFOO= fooRS.GetRows()
Now, this does get the job of getting the columns loaded into the array. However, GetRows is a multidimensional array, and contains the data about the column (datatype,max length,etc).
My goal is to pop the array into a SELECT/OPTION form and allow the user to select the column from a form. The problem is that being a multidimensional array, i do not need the other data in the array at all. Originally, was curious if its possible to drop the entire dimension of an array, maybe use of a redim preserve might be used, but no luck so far. Is there a way to getrows and only get a single dimension, or is there a way to trim a multidimensional array down to just one dimension? ie - array(0,0) becomes array(0) and I want to preserve the 2nd slot, and drop the first I believe, if that helps explain it better. Here is the option/select example:
<% for each x in arrfoo
formloopcount = formloopcount + 1
%>
<option id="optionid" value="<%=x%>" ><%=x%></option>
<% next %>
What I have is working but not as intended, because the array is multidimensional, the OPTION includes the datatype, and other data i do not need nor want displayed during the process. The drop down is displaying results like this :
COLUMNAME
INT
NO
COLUMNAME
varchar(#)
YES
So although the form works in concept, if they select the column it passes and works normally, but obviously i do not want users to select the other items or the space between them, just column names and that is it. Thank you for your time, and if you need more examples or would like elaboration, please ask. And in closing, I am aware how much validation I am going to need to do to allow a form like this to exist, but the end user wants to be able to change things on the fly, and its all an internal network, so security and access is super limited as it is, and only the CTO would even have access to the UPDATE end of this, for now, this is just a simple select, and the users doing it should have the rights to access it anyways, so long story short, I don't need a lecture on validation or SQL injection, just need some help with the array in question, but will accept any advice or alternative methods, thanks again!