I am trying to compare an email from a CSV file from facebook with the email list in my mysql database.
But when i try to query the sql, nothing happens..
if I echo the email and copy past the email into the query string, then there is not problem.
So what is it I'm doing wrong?
<?php
$row = 1;
if (($handle = fopen("test.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c = 0; $c < $num; $c++) {
$array[] = $data[$c] . "<br />\n";
}
}
fclose($handle);
}
$place = explode(" ", $array['94']);
$email = $place['11'];
$x = mysqli_query($mysql_link, "SELECT * FROM `dagenshug_newsletter_subscribe` WHERE mail_address = '" . $email . "'");
while ($row = mysqli_fetch_assoc($x)) {
$haha[] = $row;
}
print_r($haha);
?>
$place['11'] contains the mail
UPDATE:
I tried to insert it into my database, and here is the result
j a c o b s e n @ g m a i l . c o m
$email = $place[11];