Dynamic data not displaying

I’ve just started using Wappler having been an early backer. I can handle static sites with no issues, however I need to learn how to use the dynamic data features as until now I’ve used WebAssist extensions on Dreamweaver to build dynamic sites and I’d like to be able to replicate/rebuild these using Wappler. I started with something that should be simple - displaying dynamic data on a page - using this tutorial and also this video tutorial from @Hyperbytes. It’s sometimes difficult to follow as I find a lot of the tutorials and how-to guides use older versions of the software so things are in different places, but all seemed to be going well until I tried to display the data on the page - no matter what I do, it doesn’t display.

My db connection is working fine, I can see the data in the query builder, I’ve gone through the tutorial several times to make sure I haven’t missed anything, tried using both a local and remote setup, but… nothing. I’ve attached a screenshot showing what I get. Can anyone help? I’ve spent my entire weekend trying to figure out what I’m doing wrong! 2024-02-11_13h18_12|690x377

hey @linksdesign,

Did you open your page on browser?
I suppose you know how to use dev tools…
Can you check inside Network Tab, when you click on the all_users.php serveraction are there any data on the response?

That is a really old tutorial.
Best look at this series which is current.

https://youtube.com/playlist?list=PLUjqTJN3byC9W9UFjsV9f9vefe_ZSFQfb&si=EpTwuF5Nym6kVjk0

2 Likes

Thanks, I’ve been following no.4 on that too!

When I look at the Network tab in Developer Tools it thinks my action file doesn’t exist - but it’s definitely in the correct location (my latest test is on a remote staging domain)

. The Response says “A server error occured, to see the error enable the DEBUG flag.” I’ve enabled the Debug flag but it gives me no further information.

click the respond tab to see

I suppose you know the the wappler debug flag is this:

**IMPORTANT

I see you work directly on your live site (remote).
Remeber to switch off the debud mode!!

And one more observation…

Now you sent screenshot and the api is called “listusers.php”

And your initial scrrenshot named “all_users.php”

Maybe changed name and still calling the old one… that’s why you get an error?

No, I didn’t know the debug flag was there - I turned it on here, is that different?

Anyway, having now turned it on I’m still no further forward. I’ve tried testing both on localhost and on my remote server and it doesn’t work on either, so I’m starting AGAIN for the umpteenth time as I’m sure there’s a problem with the project setup. I’m using a PHP server model. When I choose the folder I want the project to live in, it’s automatically adding a /www subdirectory which I don’t want (my dedicated server root folder is httpdocs anyway) but if I try to change the folder to the root folder, it keeps reverting back to www. I think this is in turn causing an issue with file paths, although I’ve also checked the code manually to make sure everything is correct.

I’m going to start again with a completely new project and make a note/screenshots of each step which hopefully will help with troubleshooting.

Sorry, I’ve now started several new projects, deleting everything each time so that I can start afresh, so the screenshots have come from different projects hence the different names. I’m going to start again and will post each step.

1 Like

Slow my friend… Follow these great Brian’s tutorials and you will get it working.

OK, starting from scratch again…

Getting this every time I set up a new project, even though I click Yes:

Project settings (note that the web root folder has added /www even though I didn’t want it!)

Added database connection:

Create server action:

Build query:

Query loads records successfully:

Add Server Connect:

Add Bootstrap 5 cdn and Container, Row & Column:

Add Bootstrap Table Generator:

And once again, this is the result - no data:

question…

Do you save your files before testing to browser?

Yes.

screenshot for your userlist response on your browser please

Seems to be pulling the data OK (I’m having to manually browse to the file in the browser - if I click view in browser it goes to http://localhost:8100/dmxConnect/api/userlist.php which is the wrong address (again I think this is due to that /www subfolder in the project settings)

When I view the main page in the browser, it’s having problems loading some of the files:

Hi @linksdesign, I know you are frustrated, trust me, everyone here has been there at least once or twice.

Let’s break this down into pieces.

1.) Where the project files reside is really not an issue. I just created a php project and see that they are listed in the /www folder as you indicated. The files being in the /www folder is a local thing and should not affect anything because when you upload them to the remote server, you can choose which directory (or just leave as root). I believe, but could be wrong, but the /www folder is done in case you need to have files outside the root of the website.

2.) I noticed that there is not a beginning “/” in the serverconnect code. Was this something that you removed? Looks like it is missing for the dmxAppConnect at the beginning of the page as well.

Let’s try adding the “/” and see if that resolves things.

Good to know the /www subfolder isn’t the problem. I didn’t manually change any of the code - I would think the reason the “/” wasn’t in that line is because I had links set to be relative to the Document and not the Site Root in Project Options.

I have however made some small progress - I added the / to that line and then also went back into Project Options and changed the settings so that links are relative to the Site Root. I then went into Targets and found that the Web Server URL had reset itself to the default localhost folder so I changed it back to http://localhost/Dynamic_Test/www/. I refreshed the page a couple of times and still no data was showing. I then selected Table Body, tableRepeat1 in the App structure panel and then in Properties, Repeat Properties I clicked the Client Side data binding button and reselected the “userlist” API and the data suddenly displayed in the Design window!

It still doesn’t display when I preview in the browser though (although the Preview in Browser link does now go to the correct location on localhost). Debug mode is on but I still get no further information in the Network panel other than it still thinks three files don’t exist!

Ok, glad to hear you are making progress.

Let’s look at your folder where you are publishing too locally. Can you take a screenshot of the http://localhost/Dynamic_Test folder and the http://localhost/Dynamic_Test/www/ folder?

I see in one of your screenshots that in the project options you’re using routing and subfolder, what if you change from document to site root, then load your index.php file on code view, then save it and see if /www is added correctly