Re: SELECT into array of arrays

From: Date: Wed, 03 Dec 2008 15:14:32 +0000
Subject: Re: SELECT into array of arrays
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-284057@lists.php.net to get a copy of this message
Thanks Yeti, it works. Best, Andrej Yeti wrote:
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


« previous php.general (#284057) next »