PDA

View Full Version : *PLS HELP* Referencing SQL Query Recordset Items


JoeyClams
12-09-2004, 09:06 PM
ok i'm using flash remoting to connect to a CFC and returning a recordset with, for example, 2 columns and 4 rows. how do i reference the value in row 2, column 3? is the recordset being returned in the form of a multi-dimensional array? i've tried setting a variable rs to: rs = result[1][2] but to no avail...

desparately trying to get this to work- TIA

petefs
12-09-2004, 10:11 PM
I'm not 100% sure of the details of your situation, but this might help:

return mysql_query("SELECT user, password FROM users");

in flash you would access the records as such:

for(var i = 0; i < rs.length; i++) {
trace(rs[i].user);
trace(rs[i].password);
}


To see exactly how your recordset is being returned, try opening the NetConnection Debugger which will show you the structure being returned (just make sure to #include "NetDebug.as")

JoeyClams
12-10-2004, 03:28 AM
ok yeah i see - - rs[rownumber].columnname

thx a ton!