Is there a way i can map two tables and show data. (Report)

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Is there a way i can map two tables and show data. (Report)

Post by udayvatturi » 2014-07-08 07:26

Suppose i have two tables A and B.

Can I create a View which shows some rows of A and some from B (based on the query , i will write query ). No need of editing,adding, or deleting.

In short can we create something like a report.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Is there a way i can map two tables and show data. (Repo

Post by KSan » 2014-07-08 13:53

Yes. There is a way. It's a little trick.

1. Create a dummy table in AppGini With matching field types and names to what will come from table A and B.
2. Upload your app and let AppGini create this table for you on your db.
3. Enter and delete some record in this table to verify your frontend PHP is all ok.
4. Now drop that table from your db using phpMYAdmin.
5. Using phpMYAdmin create a view on your db with the same name as the table you created in step 1 and 2. This table must have matching field names and types. The view will have the SQL to bring data from tables A and B.
6. Run your application to observe your AppGini PHP can still talk to the view created in step 5.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Is there a way i can map two tables and show data. (Repo

Post by a.gneady » 2014-07-10 10:15

Nice trick, Kerem ... thanks for sharing it. I plan to add support for views in future releases.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Is there a way i can map two tables and show data. (Repo

Post by KSan » 2014-07-10 14:13

Great! Support for views would help with many needs. Thanks for considering this.

udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Re: Is there a way i can map two tables and show data. (Repo

Post by udayvatturi » 2014-07-21 09:08

Thank You Kerem. This would be very helpful to me.

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: Is there a way i can map two tables and show data. (Report)

Post by grimblefritz » 2016-01-02 16:11

Sorry to bump an old thread, but a hearty YES to views. Especially if they include calculated columns.

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: Is there a way i can map two tables and show data. (Report)

Post by D Oliveira » 2018-03-20 18:49

this trick works for mass deletion as well? when u delet stuff from table A does it get removed from the view?

Post Reply