If statement exception

Source: Internet
Author: User
If statement error here is part of the screenshot, so we may not pay attention to the size brackets, but now we are always jumping to else and cannot execute the above PHPcode $ SQL & quot; select * from # @__ tgregwhereuser & quot; read the tgreg data table. what is the condition userid URL id? * ** $ NIC_arcRow $ dsql-& gt; if statement error
This part is truncated, so we may not pay attention to the size brackets, but now we are always jumping to else and cannot execute the preceding
PHP code
  $ SQL = "Select * from ##__ tgreg where userid = '$ ID'"; // read the tgreg data table, condition userid = URL id? = *** $ NIC_arcRow = $ dsql-> GetOne ($ SQL); // A condition for setting up a data record, $ tgtime = $ NIC_arcRow ['tgtime']; // output the username value in the tgreg data table $ nowjifena = $ NIC_arcRow ['jifena ']; $ time = time (); if ($ dsql-> ExecuteNoneQuery ($ query) & $ tiem-$ tgtime> 24*3600 & $ nowjifena <11) // check if there is write {// check if there is write in brackets 1 // reserved here you need to write a sentence to get the number set in the background, after jifena is used, you do not need to manually set $ jifena = 1; // manually set the number of points to be added for jifena. // reserved $ jifenb = 100; // set the number of points recommended for jifenb. // $ dsql-> ExecuteNoneQuery ("upd Ate' #@__ member 'set 'scores' = scores + $ jifena where mid = '". $ userid. "'"); // write the SQL statement to the user and add points. // in the preceding example, add 100 points to the user data and update the 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 execution writes points to the user. // The above sentence updates the promoter's point system jifena class. Note that User Table A and user Table B are distinguished. tgreg // $ dsql-> ExecuteNoneQuery ("updat' # @__ tgreg 'set 'jifenb' = jifenb + $ jifenb where userid = '". $ userid. "'and username = '". $ username. "'"); // write the SQL execution into the user and add points // reserve the above sentence to update the promoter's point system jifenb class. Note that tgreg header ('Location: index.html ') is distinguished between user tables A and B '); // jump after writing} // Check whether there is writing in brackets 2 else {echo wrong ;}


------ Solution --------------------
Since the condition $ dsql-> ExecuteNoneQuery ($ query) & $ tiem-$ tgtime> 24*3600 & $ nowjifena <11 is required
That's right
$ Dsql-> ExecuteNoneQuery ($ query)
$ Tiem-$ tgtime & gt; 24*3600
$ Nowjifena <11
Check
------ Solution --------------------
Dsql-> ExecuteNoneQuery ($ query) & $ tiem-$ tgtime> 24*3600 & $ nowjifena <11
The landlord checks whether all of his conditions are met. You can view the output.

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.