Why cannot this code be output?

Source: Internet
Author: User
The output content of {code...} var_dump is as follows: {code ...}

  query('SET NAMES utf8');$m=$db->query('SELECT MAX(id) FROM lab')->fetch_all());echo $m[0];?>

The output of var_dump is as follows:

array(1) { [0]=> array(1) { [0]=> string(1) "1" } } 

Reply content:

  query('SET NAMES utf8');$m=$db->query('SELECT MAX(id) FROM lab')->fetch_all());echo $m[0];?>

The output of var_dump is as follows:

array(1) { [0]=> array(1) { [0]=> string(1) "1" } } 

If the array is printed with echo, an error is returned.

Arrays can only be printed, not echo

Print_r ();

That is a two-dimensional array.

Change echo $ m [0] To print_r ($ m [0]);

Understanding error information and identifying errors

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.