Re: [PHP] SELECT into array of arrays

2008-12-03 Thread Andrej Kastrin
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)) {

[PHP] SELECT into array of arrays

2008-12-02 Thread Andrej Kastrin
Dear all, I have a MySQL table 'test' which includes two columns: 'study' and 'symbol': study symbol a2008 A a2008 B a2008 C a2008 D b2005 A b2005 B b2005 E Using POST variable I passed 'study' values into $myArray: // $myArray is variable length; used only two values in example $myArray =

Re: [PHP] array_intersect question

2008-12-02 Thread Andrej Kastrin
ow","red"),array("green","red","purple"),array("green","red","yellow")); array_reduce($m_array, 'array_intersect'); but this could be wrong, havent done much with these 'meta' functions. Regards, Ti

[PHP] array_intersect question

2008-12-02 Thread Andrej Kastrin
Dear all, I have to perform an intersection on array of arrays. The fact is that php does not support intersection on multidimensional arrays. So, the first simple example using only one dimensional arrays works well: $array1 = array("green", "red", "blue"); $array2 = array("green", "yellow",