thinkphp Insert Data. It's a magical question.

Source: Internet
Author: User
It's been a program for so long. The first time you encounter this problem. No words ... There is no solution.

test.php?a=index&ac=adduser&uid=399
This address is used by thinkphp. The code might look like this:
$LinkUser = D (' Linkuser ');
$data = Array ();
$data [' nickname '] = ' test ';
$newid = $LinkUser->add ($data);
Can be added normally, but the data will be repeated, and execution will not repeat.

If the parameter becomes 400
When test.php?a=index&ac=adduser&uid=400, perform an insert. Find or repeat the 2 article.

As long as the address bar parameter value changes. will be inserted repeatedly. No change is normal. It is very puzzling ...

Ask for help again. Thank you, Good Samaritan.


Reply to discussion (solution)

This link has the front desk, is not the foreground request the same URL, refresh again because the cache problem only one URL access, so look normal?
Does the Add method in your Linkusermodel have any redefinition to secretly receive the UID?

Front Office Address:
Http://www.dooraa.com/test.php?a=index&uid=1
Direct point Add. And then the original connection on the point again. will not be repeated. Again the new connection on the dot. Will repeat. The point will not repeat.

Linkusermodel This class is actually empty.

  • 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.