What is the following code supposed to do?Answer: Each time the code runs I select distinct(id) from table. When I fetch the id's and put them into an array, they are all placed into array index '0'. I want to pass individual id's to the sql statement so I add indexes by the above logic where I iterate through by incrementing $i++.foreach $i(0..$#{$rows}) { foreach $j (0..$#{$rows->[$i]} ) { $rows->[$i][$j]; } }
I don't see how your answer relates to the code snippet I posted. Please show a data structure for $rows and what changes you expect this code to make to that data structure.
I did not mean setting $rd to a single specific value, but setting $rows to a premade dataset instead of something returned from an SQL query.
Why are you sure that the SQL code "only returns data for the first array index."? What steps did you take to find out whether you get all data or just one row of data? Have you used Data::Dumper?
You show a long block of code, but I have the feeling that you don't see the structure of your code, as I can't make out in your description what parts of the code you are talking about.
In reply to Re^5: SQL query using dynamic array
by Corion
in thread SQL query using dynamic array
by cocl04
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |