Last active
December 27, 2017 06:54
-
-
Save Jul10l1r4/03af723a10960e3386c5025a09d6fa15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date('d-m-Y'); | |
$pdo = new PDO('mysql:host=localhost;dbname=meuBancoDeDados', $username, $password); | |
$consulta = $pdo->query("SELECT email, contador, titulos, mensagens data FROM minhaTabela;"); | |
// while ($linha = $consulta->fetch(PDO::FETCH_ASSOC)) { | |
// echo "Nome: {$linha['nome']} - Usuário: {$linha['usuario']}<br />"; | |
// } Se quiser, pode usar o while | |
function voltar($a){ | |
$va1 = $a["email"]; | |
$va2 = $a["contador"]; | |
$va3 = $a["data"]; | |
if($va3 === $data){ | |
$va2 = $va2 + 1;//Aqui vai ser seu outro banco de emails ou apenas um arquivo json | |
mail($va1, titulos[$va2], mensagens[$va2]); | |
} | |
} | |
$a = array_map("voltar", $consulta->fetch(PDO::FETCH_ASSOC)); | |
print_r($a);b | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment