The brocms database query function returns an object instead of an array.

Source: Internet
Author: User
The query function of the brocms database returns an object. instead of installing the latest version of brocms connected to the array lamp, the mysqli Extension Library is selected. after installation, you find that you cannot log on to the background even if you enter the correct username and password, check the source code and find $ userD (user)-& gt; field (id, gid, username, disable )???????????????? -& Gt; where (array (objects returned by the brocms database query function, not arrays)
Brocms of lamp brocms

The mysqli Extension Library is selected during installation. after installation, you find that you cannot log on to the background even if you enter the correct username and password. after checking the source code, you find that $ user = D ("user ") -> field ('Id, gid, username, disable ')
???????????????? -> Where (array ("username" = >$ _ POST ["username"], "userpwd" => md5 ($ _ POST ["userpwd"]), "disable" => 0 ))
???????????????? -> Find (); no return value. remove find () and return an object.
------ Solution --------------------

This post was last edited by xuzuning at 18:20:38, January 15 ,.

1. read his user manual carefully.
2. since it is a returned object, you can use print_r to know how to write it.
3. few people use this Pediatrics:
A good SQL command string must be assembled with code temporarily. Time-consuming and labor-consuming
------ Solution --------------------
Of course, find () is the method of this object.
The code indicates whether the user table exists.
Username = $ _ POST ["username"],
Userpwd = md5 ($ _ POST ["userpwd"]),
Disable = 0
You can make sure that you have entered the correct username and password. You can use var_dump ($ _ POST) to compare

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.