If statement exception

Source: Internet
Author: User
If statement error
This is the Intercept section, so the size brackets may not be noticed, but now it is always jumping to the else and cannot perform the preceding
PHP Code
  $sql = "SELECT * from #@__tgreg where userid= ' $id '"; Read Tgreg data sheet, condition userid= URL ID?  =*** $NIC _arcrow = $dsql->getone ($sql);   Conditions of establishment, a data $tgtime = $NIC _arcrow[' tgtime '); Output Tgreg username value in datasheet $nowjifena= $NIC _arcrow[' Jifena '); $time = time (); if ($dsql->executenonequery ($query) && $tiem-$tgtime > 24*3600 && $nowjifena < 11)//detect write on {//detect there is write on bracket 1//reserved here to write a sentence to get background settings for the number, to Jife  Na is not used after the manual $jifena = 1; Manual Setup Jifena recommended an increase in how many points//reserved $jifenb =100;//settings Jifenb recommend an increase in how many points//$dsql->executenonequery ("Update ' #@__member ' set ' Scores ' = scores + $jifena where mid= ' ". $userid." ' //sql Execute Write user bonus points//above This example directly update user data plus 100 points, update user table Member//die ($dsql); $dsql->executenonequery ("Update ' #@__tgreg ' Set ' Jifena ' =jifena + $jifena, ' Cishu ' =cishu+1, ' tgtime ' = $time where userid= ' ". $userid." ' and Username= ' ". $username." ' ");//sql perform write user bonus points//above this sentence update promotion person's integral system Jifena class. Note the distinction between Class A and Class B user tables tgreg//$dsql->executenonequery ("Update ' #@__tgreg ' set ' jifenb ' = Jifenb + $jifenb where userid= '". $ UserID. "' And username= ' ". $username." ' //sql perform write user bonus points//reserved above this sentence update promotion person's integral system Jifenb class. Note the distinction between Class A and Class B user tables Tgreg header (' location:index.html ');//After writing also to jump the}//detection has written in parentheses 2else{echo wrong;}


------Solution--------------------
Since it is to meet $dsql->executenonequery ($query) && $tiem-$tgtime > 24*3600 && $nowjifena < 11 this condition
That's right.
$dsql->executenonequery ($query)
$tiem-$tgtime > 24*3600
$nowjifena < 11
Check it separately.
------Solution--------------------
Dsql->executenonequery ($query) && $tiem-$tgtime > 24*3600 && $nowjifena < 11
Landlord check their own this condition is not satisfied. can output to see.
  • 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.