There is a query in my PHP where I search the mailing list and return to PHP, however, it is not returning any results.
Code PHP looks like this:
<?php
session_start("admin");
if($_SESSION["admin"] == "on"){
include("../config.php");
?>
<?php
$sql = mysql_query("SELECT 'email' FROM 'n_emails' WHERE 1");
$resultado = mysql_query($sql) or die(mysql_error());
while($lista2=mysql_fetch_array($resultado)) {
$email = $lista2["email"];
$ativo = $lista2["ativo"];
if($ativo=="n"){
$ativo = "<font face='Arial' size='2' color='red'>Não confirmado</font>";
}
else{
$ativo = "<font face='Arial' size='2' color='green'>Confirmado</font>";
}
?>
<tr>
<td width="50%">
<p align="center"><b><font face="Arial" size="2"><?=$email?></font> </b></td>
<td width="25%"><?=$ativo?></td>
<td width="25%"><a href="javascript:remove('<?=$email?>')">
<font face="Arial" size="2">remover</font></a></td>
</tr><?php } ?>
<?php
}
else{
echo "<script>location.href='login.php'</script>";
}
?>
When I run this query manually, it returns me the results all correct. I do not understand what is happening.