Hi, I have generated a table that is based on a database view. The headings are displayed correctly showing the that the server side is working ok, but the table is not showing rows of test data that I have in the db view. The db view is simple, Select * from ‘db tablename’.
As a comparison I generated another table based on the ‘db tablename’, that worked perfectly.
In the image the top table is based on the db view, the bottom on db table, you can see that the rows are displayed perfectly in the db table version only.
As a check, back in MySQL, the db view displays rows perfectly.
Hi @BruceX,
I use views all the time without issue - they return data in exactly the same way as tables. If it isn’t returning results, check you haven’t got any conditions in the query (in query builder). Perhaps share your query builder settings for us to see.
You could also check to see if it is returning results but the repeat expression for the table has a problem. Has this page been published to a public location? If so, could you share a link?
The first tab, Total Activities, has 2 tables,
the top one driven from a db view defined as Select * from ActivitySteps.
The second one driven from the ActivitySteps db table itself.
I went thru everything from the defiitions in MySQL, (where the views do return a result) to the Wappler query definition (the view name is recognised with the columns names being listed) to the server connection which is set correctly, (with the sort and dir options showing up, which they only do when the server connect is valid), to the correct setting for the table on the tab. I regenerated the table and got the result, ie column headings but no data.
Well that's a known bug with views in older mysql versions - prior 5.7 on PHP (not related to Wappler).
That's why we added an option to enable prepared statements in the database connection options:
Does Wappler have any control over timeout? or is this a database thing and I need to get help from the Database Host.
Failing progress there, a plan be might be to use the db view sql from within Wappler. I notice that in the Query Definition the sql is not editable, but it is in the underlying php. This is inconvenient answer obviously but to get the views to work, is that a way to go?
@BruceX,
If this is a relatively new project, why are you using such an old version of MySQL - would you not be better off moving to something newer before you get too far down the road?
While publish is uploading, about your comment that my db is an old version, it looks to me to be mariadb ver 10+. Is that old? I am learning a lot from every answer you give me thank you, what is the minimm version that is good for wappler that perhaps I can get my host to upgrade to?
MariaDB is a fork of MySQL and acts mostly the same as MySQL. V10.0 came out in 2012 but several versions have been released since. Which 10.X version are you using?
Yehaaa, it worked, I seriously wish I could solve these problems myself, but I am 3 weeks into wappler, i really appreciate the help and patience from the team at wappler, really good.