Get data from mySQL Table

Hi,
I am new to weweb.
I have a database in MySQL, I want to edit data from one table in the Data Grid Element with Inline editing.
I created the connection to the database, and it works.
I create a collection with the table I want, and it works.
When I connected the Data Grid with the collection all rows from my table appeared in the data grid (more than 200 rows). I have set Pagination to 25 rows.
As you can see in the screenshot there is a message in the orange background saying that there is a performance issue.
Also, the Editor is too slow and crashed one or two times.

What is my mistake?
What can I do to fix it?

Hi @sotiris :wave:

On the Data Grid, did you bind to Companies-01 or Companies-01.data?

If you bind to Companies-01, you are binding to the entire collection object, regardless of the pagination, so you will be loading to many records.

If you bind to Companies-01.data, you are binding to the list of paginated objects, so only 25 at a time, and that should solve your issue.

You will need to add the Paginator element on your page, to then be able to navigate between pages. Here’s a video we have on the topic of pagination.

Does that help?

Hi Joyce,

Thank you for your response.

I changed how I get my data from the database, so I don’t have the problem now.

I am not sure, but I think I have bound the Companies-01.data.

As you can see in the screenshot there is the “limit 25” at the bottom of the screen.

I will check it again and I will inform you

Thanks

1 Like

Yes, that tells me you setup pagination properly at collection level but I can’t tell if you bound to the collection or collection data because this part here is hidden in your screenshot:

That said, I realize I got mixed up in my previous explanation! You actually need to bind to the collection and not the collection data when using the frontend pagination because the paginator needs that limit information which is inside the collection object :slight_smile:

Apologies for the confusion!

Yes, It is working now.

Thank you.

1 Like

Hi Joyce,

I have created an application using my mySQL database to view and edit data.
Everything works fine until yer=sterday.

Yesterday, when I tried to open my application I saw the following screen :

with the message :
Don’t worry, your design is still here :wink: It will reappear with repeated items when you bind your list in the “Formula” field.

Why did this happen?

To fix it, I have to bind the DataGrid object with the collection?

I tried but without success

I’m confused

This can happen when the container is bound to a collection with no data. For example, if it’s bound to a collection that only sends back information for a specific user but no user is logged in.

If you look at your collection, do you have data in there?

Hi Joyce,

There are data in my collection.

Unfortunately, I can’t make data from my collection to be displayed in my table.
The Project is: “ArgINFO MySQL”
There is only one page in this project named: “Home”
The collection name is “Companies-01”

Could you please check my project to see why I can’t display my data and inform me?

I don’t know what to do.

Without any help maybe I will stop using WeWeb.

Hi,

I think I have to start reading the manual from the beginning.

Any help will be appreciated.

Hi @sotiris :wave:

First off, well done on getting the collection in the project, it’s a good start! :grinning:

Here’s a short video showing you how you can display items from your collection in your project specifically.

To understand better how binding and displaying data works in WeWeb, I would recommend watching these two academy videos:

Does that help?

Yes it does

Thank you

1 Like