ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

merging data on account statistic

April 15, 2008 8:53am

Subscribe [2]
  • #1 / Apr 15, 2008 8:53am

    ZulloP

    9 posts

    I’m trying to include the member custom fields in account statistic, modifying the file cp.myaccount.php

    from:

    $query = $DB->query("SELECT email, ip_address, join_date, last_visit FROM exp_members WHERE member_id = '".$DB->escape_str($id)."'");

    to:

    $query = $DB->query("SELECT email, ip_address, join_date, last_visit, m_field_id_1 FROM exp_members, exp_member_data WHERE member_id = '".$DB->escape_str($id)."'");

    but it returns the following error message:

    MySQL ERROR:
    Error Number: 1052
    Description: Column ‘member_id’ in where clause is ambiguous
    Query: SELECT email, ip_address, join_date, last_visit, m_field_id_1 FROM exp_members, exp_member_data WHERE member_id = ‘19’

    anybody willing to help?
    many thanks in advance.

  • #2 / Apr 15, 2008 9:09am

    Ingmar

    29245 posts

    “ambiguous” means just that: not unique. So, try prefixing it with the table name, using either exp_members.member_id or exp_member_data.member_id, shouldn’t matter.

  • #3 / Apr 15, 2008 9:16am

    ZulloP

    9 posts

    Thank you Ingmar, problem solved.

  • #4 / Apr 15, 2008 9:31am

    Ingmar

    29245 posts

    Great 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases