Home >Backend Development >PHP Tutorial >PHP beginners write a small program to recharge Skype users' phone bills in a timely manner
In fact, there are dozens in total, but because there is a lot of data that needs to be manipulated, I added a small program at the end to solve it. It can process the data that was not processed yesterday, as follows:
Copy code Code As follows:
$handle = mysql_connect("host", "user", "password");
if(!$handle || !(mysql_select_db("databasename", $handle)))
exit();
$sql = 'select skype_id from skype_prize where prize_id = * and sn = ' ' and to_days(update_time) = to_days(now()-1)';
//Retrieve users who did not recharge their phone bills yesterday
$result = mysql_query( $sql, $handle);
if(! $result)
dlog("Info",$sql ); //Background printing
while($row = mysql_fetch_row($result))
{
$skype_id = $row[ 0];
$product_id = number;
charge_skype(gen_order_id(), $skype_id, $product_id);//Call the recharge function
}
The above has introduced a small program for PHP beginners to write to recharge Skype users' phone bills in a timely manner, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.