I'm trying to find with array_diff the values (strings) that are not present between two resulting array of mysql queries using mysql_fetch_assoc to create each array.
Query 1
<?php
mysql_select_db($database_conn, $conn);
$query_est_lista = "SELECT localidades.estacion FROM localidades ORDER BY
localidades.codigo ASC";
$est_lista = mysql_query($query_est_lista, $conn) or die(mysql_error());
$row_est_lista = mysql_fetch_assoc($est_lista);
$totalRows_est_lista = mysql_num_rows($est_lista);?>
Query 2
<?php
mysql_select_db($database_conn, $conn);
$query_est_entrada = sprintf("SELECT lluvias.estacion FROM lluvias WHERE
lluvias.fecha LIKE %s", GetSQLValueString($today_est_entrada, "date"));
$est_entrada = mysql_query($query_est_entrada, $conn) or die(mysql_error());
$row_est_entrada = mysql_fetch_assoc($est_entrada);
$totalRows_est_entrada = mysql_num_rows($est_entrada);?>
When I try to perform the check like this ...
<?php
$arr= array_diff($row_est_lista,$row_est_entrada);
foreach ($arr as $value) {
echo $value.' '.'<br>';}?>
returns the expected result but only the first value in each array and I have tried to iterate both arrays (using do {} while ()) but I can not get it to work correctly. Please suggest the correct way to iterate both arrays to find all the results.