Display Tables from Database

Permalink
I wish there is a block type in concrete5 that lets me either choose a table from existing tables in my database or upload a new table, then gets the column names from that table and asks me which ones I want to show on the page, which column to use for ordering or maybe simply asks me what is the SQL query and also asks if I need pagination or not. Maybe with some search options would be great.

I have a table in sql format which looks like this;
my-table
id CompanyName Products NAICScode Address Website

and all I want to do is to show this table on my website like this;

<table id="my-table">
<tr>
<td>CompanyName <a href="Website">website</a></td>
<td>Products</td>
<td>NAICScode</td>
<td>Address</td>
</tr>
<tr>..</tr>
..
...
</table>



Thanks in advance.

ceyhuncenger
 
Mnkras replied on at Permalink Reply
Mnkras
that would be a security risk, what if they do it on the users table, its all the emails and usernames,
ceyhuncenger replied on at Permalink Reply
ceyhuncenger
I think there was a misunderstanding. Admins and/or allowed users will add this block to the page. Therefore, users of the site will just see the table and make some search on that table or sort it however they like to.

Where I want to point is that when a website owner decides to bring his website to Concrete5 and uploads his existing tables to the database, how can he do some queries on those tables and show them on the page?

Please correct me if I am wrong but as far as I know, there is no block type to achieve this.

There is a block type called php code where owners can write some scripts and achieve that purpose but I think there should be another way using the CMS' abilities.
jordanlev replied on at Permalink Reply
jordanlev
I see what you mean, and could see how that might be useful when you're integrating C5 with some other legacy code (otherwise, why would it be in a database table in the first place?).

Neither of these addons is free, but they look somewhat related to the functionality you describe (although they seem to have their own dashboard interface for adding data to the table, so I'm not sure they will pull from any other arbitrary table in your database):
http://www.concrete5.org/marketplace/addons/tables/...
http://www.concrete5.org/marketplace/addons/data-display/...