Php beginners write small programs that promptly replenish skype users' phone charges

Source: Internet
Author: User
Some time ago, an activity went live and there was a problem that a small number of skype users did not charge their phone bills. today I went to the database (mysql) for a query, which shocked me. in this way, I may be overwhelmed by the possibility of Skype.

In fact, there are dozens of items, but because there is a large amount of data to be operated, a small program is added to solve the problem. The data that was not processed yesterday can be processed, as shown below:
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 the user who did not recharge the phone bill 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 first and continue writing again tomorrow. during this period of time, I am very grateful to colin for his understanding and help. I know that I have many shortcomings, but I will make some corrections soon. sorry for the trouble I 've put in some time ago. please believe that I have been improving. for php beginners, you are welcome to criticize and guide me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.