I am trying to send the output of a mysql query to a two dimensional array.
This is what I've tried using push.
while (@results = $sth->fetchrow_array ())
{
$x = $results[0];
$y = $results[1];
push (@data,[$x],[$y]);
}
However, I don't get back a two dimensional array, I get back a s
day, June 03, 2005 2:42 PM
To: beginners@perl.org
Subject: Two Dimensional Array Problem
I am trying to send the output of a mysql query to a two dimensional array.
This is what I've tried using push.
while (@results = $sth->fetchrow_array ())
{
$x = $results[0];
$y = $results[1]
[EMAIL PROTECTED] wrote:
> I am trying to send the output of a mysql query to a two dimensional
> array.
>
> This is what I've tried using push.
>
> while (@results = $sth->fetchrow_array ())
> {
> $x = $results[0];
> $y = $results[1];
> push (@data,[$x],[$y]);
push( @data,
[EMAIL PROTECTED] wrote:
> I am trying to send the output of a mysql query to a two dimensional array.
>
> This is what I've tried using push.
>
> while (@results = $sth->fetchrow_array ())
> {
> $x = $results[0];
> $y = $results[1];
> push (@data,[$x],[$y]);
> }
>
> However, I don't
ubject: RE: Two Dimensional Array Problem
[EMAIL PROTECTED] wrote:
> I am trying to send the output of a mysql query to a two dimensional
> array.
>
> This is what I've tried using push.
>
> while (@results = $sth->fetchrow_array ())
> {
> $x = $results[0];
]; beginners@perl.org
> Subject: RE: Two Dimensional Array Problem
>
>
> [EMAIL PROTECTED] wrote:
>> I am trying to send the output of a mysql query to a two dimensional
>> array.
>>
>> This is what I've tried using push.
>>
>> while (@results = $sth-
[snip]
Hi Brian,
I usually deal with multidimensional arrays this way:
$i = 0;
while (@results = $sth->fetchrow_array ())
{
$x = $results[0];
$y = $results[1];
@points = ($x, $y);
$data[$i] = [EMAIL PROTECTED];
$i++;
}
Just a note about a possible problem with the statement:
Always group reply so others can help and be helped, and to avoid
getting accidentally ignored.
"Because it's up-side down.
Why is that?
It makes replies harder to read.
Why not?
Please don't top-post." - Sherm Pendley, Mac OS X list
Aaron Huber wrote:
>
> On 6/3/05, Wiggins d'Anconia <[EMAIL PR