Good day,
I am climbing a wall trying to figure out why I can not retrieve the results of a mysql query to a php array.
My query polls the database and it is retrieved but all the data is encrypted. I need to take the results and put them through a decryption algorithm. Hence the need for an array because I can implement a foreach..
If I do the following:
//$record is the result of a mysql_query
list($id,$pwd,$firstname,$approved,$user_level,$salt) = mysql_fetch_row($record);
I get the variables stored in memory.
What is the simplest method to take the same result of the query and output it to an array? I want something like
$encrypted['id']
$encrypted['firstname']
etc.
I've tried
while ( $row = mysql_fetch_assoc($record)) {
$encrypted['id'] = $row['id'];
$encrypted['firstname'] = $row['firstname'];
etc.
}
but when I run it and print_r the array, there's no data. Same goes for mysql_fetch_array. If I do a dump on the individual variables stated in the list() function, they output as they should.
If I step through the code with a debugger, $row comes up as FALSE.
Any idea would be most welcome.