Forum Moderators: coopster
foreach ($array as $value) {
$query="SELECT * FROM table WHERE subject=". $value['userid']";
$result=mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
echo $row; }
}
with the above code i get the following error message:
mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
anybody an idea of how i can get around this?
thanks
m
however if i change to $value only 'array' is used in the new query - with the code i posted the queries were generated but the second fetch_assoc seems to have a problem ...
using this:
foreach ($array as $value) {
$query="SELECT * FROM .... WHERE subject='".$value['userid']."'";
echo $query;
$result=mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
echo $row;
i get:
SELECT * FROM mlweb WHERE subject='...' VERY LONG LIST OF IP Adresses * FROM mlweb WHERE
m