Why doesn't the array contents of Ecshop getAll print?

Source: Internet
Author: User
$sql = "Select user_id, Content from". $GLOBALS [' ECS ']->table (' Reg_extend_info '). WHERE content = ' $filter [Tuijianren] ';
$row = $GLOBALS [' db ']->getall ($sql);
$ex _where. = "and user_id in (' $row [user_id] ')";


Print_r ("
");   
Print_r ($row [' user_id ']);
Print_r ("
");
Die ();

I was based on ecshop development, why the GetAll query table field is not read? and Print_r ($row), there is content, or change getall to GetRow words print_r ($row [' user_id ']) Normal, Print_r ($row) is normal.

I want to get all the values of $row[' user_id '], that is, to query the name of the member of the referrer, how should I change it?
Give 100 points, thank you!


Reply to discussion (solution)

$row is a two-dimensional array, you should handle it as a one-dimensional array, of course.

Print_r ($row); What's the result?

$row is a two-dimensional array that needs to be output

foreach ($row as $k = + $v) {  echo $v [' user_id ']. '
';}

Print_r ($row); What's the result?


Print Out is
Array
(
[0] = = Array
(
[USER_ID] = 55
[Content] = A923168
)

[1] = = Array
(
[USER_ID] = 56
[Content] = A923168
)

[2] = = Array
(
[USER_ID] = 60
[Content] = A923168
)

[3] = = Array
(
[USER_ID] = 63
[Content] = A923168
)

)

Print_r ($row [0][' user_id ']);

Newcomers come to study

Problem solved, thank you for the replies, have given points, thank you

  • 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.