How do I do that using SQL queries?

I need a code to do that:
For every "Name" on "names" column on DataBase, do this:

 {
 name: 'NameX',
 data: [Value from name X]
  }

I need a code to display in categories, all names that theres in the "names" column automatically, so I would not have to insert manually the name in the chart settings each time I add a new name.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.