Re: SELECT into array of arrays

From: Date: Wed, 03 Dec 2008 08:11:47 +0000
Subject: Re: SELECT into array of arrays
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-284042@lists.php.net to get a copy of this message
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 (#284042) next »