Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6378309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:59:19+00:00 2026-05-25T01:59:19+00:00

I have 7 column in my table users. The columns are like this: ac0

  • 0

I have 7 column in my table “users”. The columns are like this:

ac0 // Represents clicks made today
ac1 // Represents clicks made from ac0
ac2 // Represents clicks made from ac1
ac3 // Represents clicks made from ac2
ac4 // Represents clicks made from ac3
ac5 // Represents clicks made from ac4
ac6 // Represents clicks made from ac5

I have to show this in a chart, that is build up like this:

xAxis: {
categories: ['Today', 'Yesterday', '12-08', '11-08','10-08','09-08','08-08']
},
series: [{
name: 'Clicks',
data: [1,4,5,2,6,4,6]
}]

As you can see, I have to insert the ac# into the data:[] field, and then add a date to each, to insert in the categories:[].

How can this be obtained?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:59:19+00:00Added an answer on May 25, 2026 at 1:59 am

    If you only need to populate “categories” and “data” it’s even easier:

    <?php
        mysql_connect('localhost', 'root', '');
        $link = mysql_connect('localhost', 'root', '') or die('Could not connect: ' . mysql_error());
        mysql_select_db('test') or die('Could not select database');
    
        // Performing SQL query
        $query = 'SELECT ac0, ac1, ac2, ac3, ac4, ac5, ac6 FROM users WHERE id = 1';
        $result = mysql_query($query) or die('Query failed: ' . mysql_error());
    
        while ($row = mysql_fetch_array($result, MYSQL_NUM))
        {
            $data = $row;
        }
    
        $days = array('Today', 'Yesterday');
        for ($i=2; $i<7;$i++)
        {
            $days[$i] = date('d-m', strtotime('-'.$i.' day'));
        }
    ?>
    xAxis: {
    categories: ['<?php echo implode("', '", $days); ?>']
    },
    series: [{
    name: 'Clicks',
    data: [<?php echo implode(',', $data)?>]
    }]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mySQL query to get columns from a table like this: String
I have a database table called users This table has two columns (that are
I have a table [Users] with the following columns: INT SmallDateTime Bit Bit [UserId],
I have a table of users which has a username column consisting of a
I have a table(users) with columns as id INT AUTOINVREMENT PRIMARY uid INT index
I have a 'users' table with two columns, 'email' and 'new_email'. I need: A
I've tried this: SELECT first_name,last_name,company_name FROM users ORDER BY last_name, company_name ASC I have
I have a table defined like this: CREATE TABLE mytable (id INT NOT NULL
Consider i have a user table and I have three columns mobilePhone , homePhone
I have a table User which has an identity column UserID , now what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.