GetOne? Sometimes failure solution

Source: Internet
Author: User
GetOne? Sometimes PHPcodefunctionGetMaxLevel ($ model) {$ SQL = & quot; selectmax (slevel) fromboxfilewhere GetOne? Sometimes invalid
PHP code
  Function GetMaxLevel ($ model) {$ SQL = "select max (slevel) from boxfile where model = '$ model '"; $ record_nums = $ this-> db-> GetOne ($ SQL); // print_r ($ record_nums); return $ record_nums ;}

Why does this function occasionally fail? I just returned the maximum value, but then I didn't return the maximum value. I felt that I didn't change anything ..

------ Solution --------------------
Are you sure you want to see the method of invalid and valid calls? is the parameter passed the same?

------ Solution --------------------
You encapsulated it yourself. in this case, it's hard to see the problem.
Let's take a look at the specific getOne statement. Is it a resource, an int, or another type?
------ Solution --------------------
Output your own sentence

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.