Database Connection

I have a page that uses a database connection to display testimonials in a repeat region. I have had the page working using a local testing environment. I want to now upload the page to the live server so i’ve added a live db connection. Once I change the database connection to the live connection in the query properties for the action it the page doesn’t load ( show ) the repeat region using the query.

Plus now if i switch back to the local connection that now doesn’t work either.
Not sure where I’m going wrong with this
Any help would be hugely appreciated!

Hello Steven,
You should not define a separate connection for the testing and live servers.
You define the connection once in Wappler Globals but then define different connection details per local and remote targets …

Hi Teodor, That looks the same as what I have in Globals… see attachments.
SO how do get the remote connection working for my API action? I’m confused!

You have two connections defined. You need only one! Then you define its settings per target as explained in the docs i linked to.

OK so I have started again, deleted both connections and setup up one new connection using the local target. But not working!! can you say anything wrong here?

What is not working exactly? Your screenshots show nothing helpful.

what can I show you that is helpful? Basically the page loads but the repeat region doesn’t display anything!

You said "It's not working" - which really tells me nothing about what exactly is not working ....

Well as usual, when you have server side related issues just check for a detailed error from your server as explained here:

With all due respect Teodor. A the very beginning of this post I made it clear that the it was database connection that was not working. i’ve tried the debug mode using the browser dev and no errors are being shown. So before I post any more unhelpful screenshots. maybe you can advise me on what I need to do to get this sorted.

Open your page in the browser and follow the steps explained here:

What do you see under Network > XHR? Is the server action loading? What does it return? What is its status?

It doesn’t show anything. I must have something wrong in the set up somewhere. I just haven’t got a clue what im doing wrong!

I see no server action running on your page. Is it included there? Are you sure if it’s included that it’s not set to “No Auto Run”?

if you mean under ‘Server Connect Properties’ and the check box ‘no auto load’ then no its not .

Im just going to revert back to commit in my repo to when I had it working locally. then start again from there.

I now see why you don’t see anything in the dev tools … you have entered r here:

make sure this filter input is empty then you will see the data below …

ok Teodor sorry about that… OK so i’ve got the local testing environment working again.
See screen recording. for you to see the page viewing properly.

So now correct me if i’m wrong.

  1. setup a new target with remote ftp details.
  2. then make sure the remote target is selected and go to the connection properties and change to remote DB details.

Anything else I need to make sure I do correctly?

Yes exactly. And if it doesn't work then follow:

to see the exact error.

Enable the output option

OK so i local target is working with no errors. But the remote target shows a 500 error?

I guess I need to upload to the server to reflect the local settings. I need some guidance on uploading to remote server. Can I upload just selected files and related files? I don’t want to reflect local files with remote files as I have a blog section that i don’t have locally

As explained in the docs above - click the Preview/Response to see the detailed error which is what we are looking for from the beginning.