The_Return
08-25-2009, 12:52 AM
It displays everything at the echo but its not deleting it nor does it give a error
the database looks like this:
http://screensnapr.com/u/7w4fh8.png
http://screensnapr.com/u/kg8pf1.png
The echo matches the same in the database....so I'm clueless whys not removing.
<?php
ob_implicit_flush(true);
include("aimclassw.php"); //Toc
//database connect
$query3 = "SELECT COUNT(*) as num FROM jobs WHERE status = '0'";
$total_jobs = mysql_fetch_array(mysql_query($query3));
$total_jobs = $total_jobs[num];
if ($total_jobs > 0) {
$b = new Aim("screenname","password",4);
$b->registerHandler("Config","onConfig");
$b->registerHandler("Nick","onNick");
$b->signon();
sleep(3); // delay after sign in
}
if ($total_jobs > 0) {
while(!defined("CAN_SEND")){
$b->receive();
}
}//end if
function onConfig()
{
define("CAN_SEND",1);
return;
}
if ($total_jobs > 0) {
$query = "SELECT * FROM jobs WHERE status = '0'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
$message = $row['message'];
$hostid = $row['hostid'];
//select all the aims with the host id given
$q = "SELECT aim FROM friends WHERE hostid = '$hostid'";
$re = mysql_query($q) or die(mysql_error());
while($r = mysql_fetch_array($re)){
$aim = $r['aim'];
$b->sendIM("$aim","$message");
sleep(3);
}//End while loop
$query2 = "DELETE FROM jobs WHERE message = '$message' AND hostid = '$hostid'";
$result2 = @mysql_query($query2);
echo "It should have deleted this message $message and this hostid $hostid";
} //end loop
}//End if
?>
the database looks like this:
http://screensnapr.com/u/7w4fh8.png
http://screensnapr.com/u/kg8pf1.png
The echo matches the same in the database....so I'm clueless whys not removing.
<?php
ob_implicit_flush(true);
include("aimclassw.php"); //Toc
//database connect
$query3 = "SELECT COUNT(*) as num FROM jobs WHERE status = '0'";
$total_jobs = mysql_fetch_array(mysql_query($query3));
$total_jobs = $total_jobs[num];
if ($total_jobs > 0) {
$b = new Aim("screenname","password",4);
$b->registerHandler("Config","onConfig");
$b->registerHandler("Nick","onNick");
$b->signon();
sleep(3); // delay after sign in
}
if ($total_jobs > 0) {
while(!defined("CAN_SEND")){
$b->receive();
}
}//end if
function onConfig()
{
define("CAN_SEND",1);
return;
}
if ($total_jobs > 0) {
$query = "SELECT * FROM jobs WHERE status = '0'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
$message = $row['message'];
$hostid = $row['hostid'];
//select all the aims with the host id given
$q = "SELECT aim FROM friends WHERE hostid = '$hostid'";
$re = mysql_query($q) or die(mysql_error());
while($r = mysql_fetch_array($re)){
$aim = $r['aim'];
$b->sendIM("$aim","$message");
sleep(3);
}//End while loop
$query2 = "DELETE FROM jobs WHERE message = '$message' AND hostid = '$hostid'";
$result2 = @mysql_query($query2);
echo "It should have deleted this message $message and this hostid $hostid";
} //end loop
}//End if
?>