Original geschrieben von Sardine
dann kommt die von "neogrande" zum Einsatz (die läuft bestimmt)!
dann kommt die von "neogrande" zum Einsatz (die läuft bestimmt)!
CREATE TEMPORARY TABLE dummy(a)
CREATE TEMPORARY TABLE dummy as select customers_email_address
as email from customers where customers_newsletter like 1
CREATE TEMPORARY TABLE dummy as select customers_email_address
as email from customers where customers_newsletter like 1 insert
into dummy AS SELECT email from newsletter
$array[$i] = $row->$email
if (!in_array($row2->customers_email_address, $array)) echo "blubb..."
$result = mysql_query("SELECT email_zwei as email FROM `tabelle2` WHERE `check`");
$result2= mysql_query("select email from tabelle1");
$test=mysql_fetch_array($result2);
while ($ausgabe = mysql_fetch_array($result))
{
if(!in_array($ausgabe["email"],$test))
echo "nicht drin<br>";
mysql_query("insert into tabelle1 (email) values ('$ausgabe[email]')");
}
$result = mysql_query("SELECT email_zwei as email FROM `tabelle2` WHERE `check` like 1");
$result2= mysql_query("select email from tabelle1");
$test=mysql_fetch_array($result2);
while ($ausgabe = mysql_fetch_array($result))
{
if(!in_array($ausgabe['email'],$test))
echo "nicht drin<br>";
mysql_query("insert into tabelle1 (email) values ('$ausgabe[email]')");
}
$test=array('abc','def','vw','xyz');
//-->so funktionierts
$test=mysql_fetch_array($result2);
//-->so nicht
while ($ausgabe = mysql_fetch_array($result))
{
$email=$ausgabe['email'];
echo "$email";
if(!in_array($email,$test))
{
echo "nicht drin<br>";
mysql_query("insert into tabelle1 (email) values ('$ausgabe[email]')");
}
}
Kommentar