The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API2_query output problem

Discussion in 'cPanel Developers' started by ankitpsaraogi, Sep 18, 2014.

  1. ankitpsaraogi

    ankitpsaraogi Registered

    Joined:
    Sep 18, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi,
    I used the following code
    PHP:
    include '../xmlapi.php';

    $ip 'ip';
    $root_pass 'pwd';

    $account "acc";

    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth($account,$root_pass);
    $xmlapi->set_output("json");
    $xmlapi->set_port(2082);
    $xmlapi->set_debug(1);
    $output $xmlapi->api2_query($account"Email""listpopswithdisk" );
    print 
    $output;
    The output was in
    such a format
    {"cpanelresult":{"apiversion":2,"preevent":{"result":1},"data":[{"mtime":1411037171,"diskquota":"unlimited","_diskused":"54

    I want the output to be in a table. Can anyone suggest
    how can I do so
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. tdl

    tdl Member

    Joined:
    Jun 18, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Can you clarify, do you want to store this data in a MySQL table or do you want to output as an HTML table?
     
  4. sf.basilix

    sf.basilix Registered

    Joined:
    Feb 16, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I'm trying to learn this and am curious how to do this also - would you be able to provide an example for each (as a MySQL table and as HTML)?

    Thanks in advance!
     

Share This Page