Warning: mysql_fetch_array(): supplied argume
dudd
-
Steevy -
Steevy -
Bonjour,
Je développe une function qui envois des email de notification sur mon forum (bbpress)
J'ai cette erreur :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /.../monscript.php on line 17
Mon code :
Je développe une function qui envois des email de notification sur mon forum (bbpress)
J'ai cette erreur :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /.../monscript.php on line 17
Mon code :
function notification_reponse() {
global $topic_last_post_link, $topic_id;
$header = 'From: '.bb_get_option('from_email')."\n";
$header .= "Content-type: text/html; charset= iso-8859-1\n";
$msg =__('<p>Vous avez reçu une réponse pour votre question posée sur le forum commentguerir.</p><p>Pour lire cette réponse veuillez visiter cette page :</p>').get_topic_last_post_link($topic_id).__('<p>Pour ne plus recevoir de notifications, veuillez répondre à cet email avec comme titre: désinscription</p>');
$msg = utf8_decode($msg);
$niv1= mysql_query("select post_id from bb_posts where topic_id=$topic_id");
while ($donnee1=mysql_fetch_array($niv1)){
$all = mysql_query("select meta_value from bb_meta where meta_key = 'post_email' and object_id = $donnee1[post_id]") ;
while ($donnee2 = mysql_fetch_array($all)){
$lastpost=mysql_query("select topic_last_post_id from bb_topics where topic_id=$topic_id limit 1");
$lastpost1=mysql_fetch_array($lastpost);
if ($donnee1[post_id]!=$lastpost1[topic_last_post_id]){
bb_mail($donnee2[meta_value], "Une réponse à votre question", $msg, $header);
}
}
}
}
A voir également:
- Warning: mysql_fetch_array(): supplied argume
- Warning zone telechargement - Accueil - Outils
- Téléchargement et streaming illégal : voici les adresses des sites pirates que les FAI vont bloquer - Accueil - Services en ligne
- Symbole warning word ✓ - Forum Word
- Cpu fan fail warning control - Forum Matériel & Système
- Comment faire le symbole attention ✓ - Forum Loisirs / Divertissements
2 réponses
Tu peux aérer ton code pour qu'on y voie un peu mieux... sinon pour plus d'info su l'erreur utilise or die
Essaye ça ca fonctionnera déjàs mieux
<?
function notification_reponse() {
global $topic_last_post_link, $topic_id;
$header = "FROM: ".bb_get_option("from_email")."\n";
$header .= "Content-type: text/html; charset= iso-8859-1\n";
$msg =__("<p>Vous avez reçu une réponse pour votre question posée sur le forum commentguerir.</p><p>Pour lire cette réponse veuillez visiter cette page :</p>").get_topic_last_post_link($topic_id).__("<p>Pour ne plus recevoir de notifications, veuillez répondre à cet email avec comme titre: désinscription</p>");
$msg = utf8_decode($msg);
$niv1= mysql_query("SELECT post_id FROM bb_posts WHERE topic_id=".$topic_id."") or die ('Erreur SQL !'.$niv1.'<br>'.mysql_error());
while ($donnee1=mysql_fetch_array($niv1)){
$all = mysql_query("SELECT meta_value FROM bb_meta WHERE meta_key = 'post_email' and object_id = ".$donnee1["post_id"]."") or die('Erreur SQL !'.$all.'<br>'.mysql_error());
while ($donnee2 = mysql_fetch_array($all)){
$lastpost=mysql_query("SELECT topic_last_post_id FROM bb_topics WHERE topic_id=".$topic_id."") or die('Erreur SQL !'.$lastpost.'<br>'.mysql_error());
$lastpost1=mysql_fetch_array($lastpost);
if ($donnee1["post_id"]!=$lastpost1["topic_last_post_id"]){
bb_mail($donnee2["meta_value"], "Une réponse à votre question", $msg, $header);
}
}
}
}
?>