Query bug: Data from Query (Left Panel) not the same as in App Connect (Right Panel)

Hello ! I spent the last 3 hours for reproducing that bug. Its similar maybe not same as posted yesterday @Teodor knows.

I prepared a Screenshot showing what I’m messing arround. To be sure I recreated all parts from scratch. Server Action, Query + Connect and App Connect side. I get the same results in App Connect.

  • Maybe the problem is to query with * Asterisk. I do this, cause it gives me more freedom later, instead of defining each column.
  • Maybe the query or JOIN makes problems with Wappler on APP Connect. (I Used Dataview)

Does anybody get the same results? What could I do wrong?

Thanx so much for any help, as I’m so stuck with that.

My Json is quite fine. So Query works: (Proof)

{"queryMyAdvertsFromLoggedUser":[{"id":357,"user_id":158,"status":0,"name":"Some Text here","street":"Some Street Name" ,"street_nr":"12f","postal_code":"55323","city":"Bangkok","country":null,"description":null,"extended_description":"<p >gfd fsdgsdfgsfdg sfdgfsg<\/p><p >dfs<\/p><p >gsdf gsfdg sdf g<\/p><p >fsdgsd<\/p>","deathline":"2018-12-12 00:00:00","start":"2018-12-17 00:00:00","created":"2018-12-12","advert_id":128,"path":"\/upload\/IMG_4.JPG","filename":"IMG_4.JPG","alt":null,"display_order":0}]}

Ok and now without using * ASTERISK and it works… Damn! would be nice to fix that…

And here the App Connect Data Binding:

I suspect the problem is related to naming for fields.
When using * in both tables you have a name conflict as both tables have a field called id. You will have to specify the names and set an alias for one of them or change the table fields names so they do not conflict.

(check browser console, you will probably have a 500 error in there)

2 Likes

Actual the databinding panel having the name column twice is also wrong, it should display the name only once. The second name column will overwrite the first column, you should use an alias in this case.

The first databinding panel is indeed only showing the first table columns, this is probably an bug.

We will investigate these issues.

okay thanx so much! I use asterisk queries mostly for more flexibility and from a view of SQL it must be possible. But maybe some ERROR prevention or alert box would be amazing and help other users.

FYI: I cant use Alias if using Asterisk queries as I know :stuck_out_tongue_closed_eyes:

@Hyperbytes ok Ill try that but I remember I had some 500error in Debug! So You‘re right and I couldnt trigger that strange bug down. As discussed in a best practice post some weeks ago we spoke about using Unique Unique columns over all tables. But thats sometimes not easy and as far as I know not how Table Design should be done…? Not sure, but correct me if I‘m wrong. But I think the only way to prevent double columnnames is to change tables from:

t_user
id
age
note
timestamp

t_post
id
text
note
timestamp

to new table design and use kinda prefix or so:

t_user
user_id
user_age
user_note
user_timestamp

t_post
post_id
post_text
post_note
post_timestamp

This Post is also related to my older/previous one where @Teodor responded and maybe I mixed up two different things. One of it was that bug, explained in this post now.

Appendix:

Its not good to use prefix… https://stackoverflow.com/questions/234902/what-is-the-best-practice-for-naming-database-tables-to-provide-natural-organiza

… avoid prefix:

It is probably bad practice to prefix all fields unless there is a good reason to do so but sometimes it is necessary. I do however prefix id fields as a matter of course as it is so critical that there is no confusion over which id you are using. Prefixing does lead to a clearer understanding of what is happening, personally i see it as a matter of choice.

The normal method would be specify the fields individually where a conflict exists and set an alias where naming conflicts exits

So your choice is change the conflicting fields names or specify the fields individual and alias as necessary.

This is now improved in the latest version 1.7.0

1 Like