Hey guys,
I feel like this is a huge noob question, but I feel like it may have something to do with the face that I'm using a nested SQL statement.
here is what is returned when I execute the SQL from the command line:
mysql> select distinct request from T_LOG where request in (select request_num from T_REQUEST where status < 2) and cc like '%blah@blah.com%';
+---------+
| request |
+---------+
| 16311 |
| 17331 |
| 17387 |
| 17415 |
| 17420 |
+---------+
5 rows in set (0.00 sec)
When I run the following PHP, only one element is returned:
$query = "select distinct request from T_LOG where request in (select request_num from T_REQUEST where status < 2) and cc like '%blah@blah.com%';";
$result = mysql_query($query)
or die(mysql_error());
$datacrap = mysql_fetch_array($result,MYSQL_ASSOC);
echo "<BR><BR>";
var_dump($datacrap);
Here is the HTML output:
array(1) { ["request"]=> string(5) "16311" }
What am I doing wrong?