Home > Backend Development > PHP Tutorial > PHP beginners write a small program that can recharge Skype users' phone bills in a timely manner_PHP Tutorial

PHP beginners write a small program that can recharge Skype users' phone bills in a timely manner_PHP Tutorial

WBOY
Release: 2016-07-21 15:49:21
Original
1210 people have browsed it

In fact, there are dozens of them 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 The code is 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 charge 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
}

Write so much now and continue tomorrow I am writing, I am very grateful to my leader (colin) for his understanding and help during this period of time. I know that I have many shortcomings, but I will correct them soon. I am sorry for causing you so much trouble some time ago. I hope you can forgive me. Please believe that I have been making progress. Since I am new to PHP, I welcome your criticism and guidance.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319606.htmlTechArticleIn fact, there are dozens in total, but because there is a lot of data that needs to be manipulated, I added a paragraph at the end A small program can be used to solve the problem. It can process data that was not processed yesterday, as follows: Copy the code...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template