# Get data from mySQL Table

**URL:** <https://community.weweb.io/t/get-data-from-mysql-table/4652>\
**Category:** Ask us anything\
**Created:** [September 29, 2023, 6:47am UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652 "2023-09-29T06:47:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sotiris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sotiris/32/5189_2.png) [@sotiris](https://community.weweb.io/u/sotiris)\
**Post date:** [September 29, 2023, 6:47am UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/1 "2023-09-29T06:47:24Z")

</div>

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?

 ![Error-01](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/fe787110a25fb21e513ac0279db4ded83edd4b27.png)

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 29, 2023, 9:50am UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/2 "2023-09-29T09:50:29Z")

</div>

Hi @sotiris 👋

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](https://academy.weweb.io/scale-your-web-app/pagination/).

Does that help?

---

<div class="post-metadata">

**Author:** ![sotiris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sotiris/32/5189_2.png) [@sotiris](https://community.weweb.io/u/sotiris)\
**Post date:** [September 29, 2023, 10:43am UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/3 "2023-09-29T10:43:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 29, 2023, 3:20pm UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/4 "2023-09-29T15:20:36Z")

</div>

> [@sotiris](#):
>
> As you can see in the screenshot there is the “limit 25” at the bottom of the screen.

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:

 ![CleanShot 2023-09-29 at 17.09.05@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/201083f2938d498e38376ebfb1f703761a28d842.jpeg)

That said, I realize I got mixed up in my previous explanation! You actually need to [bind to the collection](https://docs.weweb.io/add-elements/elements/paginator.html#frontend-pagination) and not the collection data when using the frontend pagination because the paginator needs that `limit` information which is inside the collection object 🙂

Apologies for the confusion!

---

<div class="post-metadata">

**Author:** ![sotiris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sotiris/32/5189_2.png) [@sotiris](https://community.weweb.io/u/sotiris)\
**Post date:** [September 29, 2023, 3:43pm UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/5 "2023-09-29T15:43:44Z")

</div>

Yes, It is working now.

Thank you.

---

<div class="post-metadata">

**Author:** ![sotiris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sotiris/32/5189_2.png) [@sotiris](https://community.weweb.io/u/sotiris)\
**Post date:** [October 5, 2023, 9:06am UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/6 "2023-10-05T09:06:16Z")

</div>

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 :

 ![image.png](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4e2f2ec3910442981a9b9ea19b2885765d30a265.png)

with the message :  
**Don’t worry, your design is still here 😉 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

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [October 5, 2023, 2:38pm UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/7 "2023-10-05T14:38:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sotiris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sotiris/32/5189_2.png) [@sotiris](https://community.weweb.io/u/sotiris)\
**Post date:** [October 8, 2023, 8:18am UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/8 "2023-10-08T08:18:26Z")

</div>

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](https://editor.weweb.io/afffcd6f-18ce-423b-8541-e1b5c8136bc2)”  
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.

---

<div class="post-metadata">

**Author:** ![sotiris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sotiris/32/5189_2.png) [@sotiris](https://community.weweb.io/u/sotiris)\
**Post date:** [October 8, 2023, 4:24pm UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/9 "2023-10-08T16:24:00Z")

</div>

Hi,

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

Any help will be appreciated.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [October 9, 2023, 12:22pm UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/10 "2023-10-09T12:22:48Z")

</div>

Hi @sotiris 👋

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

Here’s a short video showing you how you can [display items from your collection](https://tella.video/sotiris-binding-data-3qti) in your project specifically.

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

- [Display data](https://academy.weweb.io/build-a-proof-of-concept/display-items-from-collection/)
- [Paginate a collection](https://academy.weweb.io/scale-your-web-app/pagination/)

Does that help?

---

<div class="post-metadata">

**Author:** ![sotiris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sotiris/32/5189_2.png) [@sotiris](https://community.weweb.io/u/sotiris)\
**Post date:** [October 9, 2023, 1:53pm UTC](https://community.weweb.io/t/get-data-from-mysql-table/4652/11 "2023-10-09T13:53:04Z")

</div>

Yes it does

Thank you
