Diciamo che l’insert ultima era vuota, ma
l’ho abbondato tale codice.
Da:
Inviato: sabato 30 maggio 2009
16.49
A:
Oggetto: R: [php-italia] Problemi
col programma php chi mi da dire dove sbaglio?
|
Qual'e' il problema che riscontri?
Ciao, ho
problemi col programma sotto che non funziona a dovere. Non riportata
dati come dovrebbe per poi fare l’’insert query che si può fare con php su
mysql. Credo che sia il flush() che crea buffer che dovrebbe portare fuori i
dati per l’insert mysql ma perché non funziona? Idee su come posso risolvere? Sperando
in un’aiuto. Ciao, Pier <? //**VS**//$setting[ include("config. include("includes/ include("includes/ $Db1
= new DB_sql; $Db1->connect($DBHost,
$DBDatabase, $DBUser, $DBPassword) include("includes/ flush(); //**S**// function
get_users($count, $country) {
global $Db1;
$sql=$Db1->query("SELECT username, name, email FROM user WHERE
suspended=0 and optin='1' ".iif($country != ""," and
country='$country'
for($x=0; $temp=$Db1->fetch_array(
$list[$x]=$temp;
}
return $list; } echo
"Connected <br/>"; //
if($settings[ //
$sq1=$Db1->query("DELETE FROM click_history" //
$sql=$Db1->query("DELETE FROM email_history"
$sql=$Db1->query("DELETE FROM pending_emails"
$sql=$Db1->query("SELECT * FROM emails WHERE credits>=1");
while($mail=
$mailid=$mail[
echo "<!-- Starting Email Loop -->\n\n"; flush();
$emailsubject = "$mail[title]
$emailbody = "".stripslashes(
$users = get_users($mail[
$user_index=
if ($mail[credits]<=count($list)
$e='';
for($x=0; $x<=$mail[credits]
flush();
$e.= $users[$user_
$user_index+
}
}
if
($mail[credits]>count($list)
$e='';
for($x=0; $x<count($list)
flush();
$e.= $users[$user_
$user_index+
}
}
echo "<!-- Creating Entry -->\n\n";
flush();
$Db1->query("INSERT INTO pending_emails SET
mailid='".$mailid.
subject='".addslash
body='".addslashes(
tolist='".addslashe
");
} echo
"<!-- All Done -->\n\n"; flush(); exit; function
sendmail($mail, $user) {
global $settings;
$subject = "$settings[site_
$body = "".stripslashes( To
receive credit for this email, Please click the following URL $settings[base_ \n ------------ $settings[site_ You
are receiving this email because you are a member of $settings[domain_ you
want to stop receiving emails, please login to your account turn off
paid emails in your profile page. ------------
send_mail($user[
echo "<!- Finished Mailing $user[username] !>\n\n";
flush(); } function
mailgo($mail) {
global $Db1; }
//
if($settings[
$sql=$Db1->query("SELECT * FROM emails WHERE credits>=1");
while($temp=
$emails[$x][
$sql=$Db1->query("SELECT username, email FROM user
WHERE optin='1' and username!='$
while($user=
echo ".";
flush();
sendmail($mail, $user);
}
}
$Db1->sql_close();
while($temp=
$sql=$Db1->query("SELECT username, email FROM user WHERE optin='1'
and username!='$
while($user=
echo ".";
flush();
sendmail($mail, $user);
}
} //
} //
else { //
echo "Invalid Access To Cron!"; // } //**E**// ?> |