Re: SELECT into array of arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Correcting myself now ..

$myArray = array('b2005', 'b2008');
$sql = "SELECT study,symbol FROM test WHERE study IN ('$myArray[$i]')";
$result = mysql_query($sql);

if(mysql_num_rows($result) > 0) {
  while ($myrow = mysql_fetch_array($result)) {
      if (in_array($myrow['study'], $myArray))
$combinedArray[$myrow['study']][] = $myrow['symbol'];
  }
}

Forgot to get rid of the first for loop

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux