Excuse me: What do you mean by this two-sentence database operation statement?

Source: Internet
Author: User
$level 1=pdo_fetchall (' Select ID from '. TableName (' Shop_member '). ' Where agentid= '. $member [' id ']. "' ', ' id ');

$level 2=pdo_fetchall (' Select ID from '. TableName (' Shop_member '). ' Where Agentid in ('. Implode (', ', Array_keys ($level 1)). ') ', ' id ');

1th: Statements end up with a, ' id ' what does that mean?

2nd: Where Agentid in ('. Implode (', ', Array_keys ($level 1)). ') ', ' id ' doesn't understand

Thanks, man.


Reply to discussion (solution)

you echo $level 1; echo $level 2; I'll see.
$level 1 is to read a Agentid record
$level 2 is to read a set of Agentid records

you echo $level 1; echo $level 2; I'll see.
$level 1 is to read a Agentid record
$level 2 is to read a set of Agentid records



you echo $level 1; echo $level 2; I'll see.
$level 1 is to read a Agentid record
$level 2 is to read a set of Agentid records


Is the association ID, which is then grouped by ID

One is to read Id=xxx records.
The other is to read id=xxx or id=xxx1 or id=xxxx2 records.

One is to read Id=xxx records.
The other is to read id=xxx or id=xxx1 or id=xxxx2 records.


$sql = $empire->query ("select UserID from member where Agentid= '". $user [UserID]. "' GROUP by UserID ');

$sql 2= $empire->query ("select UserID from member where Agentid in ('). Implode (", Array_keys ($sql)). ') GROUP by userid ");

The first statement reads 3, but the second MySQL statement does not read the first piece of data

You echo "Select UserID from member where Agentid in ('. Implode (", Array_keys ($sql)). ') The results of GROUP by UserID in phpMyAdmin do you have data?

You echo "Select UserID from member where Agentid in ('. Implode (", Array_keys ($sql)). ') The results of GROUP by UserID in phpMyAdmin do you have data?


Array_keys ($sql) is the result of the previous MySQL statement query, which is then queried based on the last statement and grouped by the group by UserID
  • 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.