Database Connection

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.

Well, i can see your query

Here’s the preview/Response

code: 2002 file: "/home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/lib/db/Connection.php" line: 103 message: "SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)" trace: "#0 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/lib/db/Connection.php(103): PDO->__construct('mysql:host=loca...', 'root', 'root', Array)\n#1 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/lib/db/Connection.php(24): lib\\db\\Connection->__construct(Object(lib\\App), Object(stdClass), 'localhost')\n#2 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/modules/dbconnector.php(26): lib\\db\\Connection::get(Object(lib\\App), 'localhost')\n#3 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/lib/App.php(195): modules\\dbconnector->select(Object(stdClass), 'query', Array)\n#4 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/lib/App.php(127): lib\\App->execSteps(Object(stdClass))\n#5 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/lib/App.php(116): lib\\App->exec(Object(stdClass), false)\n#6 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnectLib/lib/App.php(94): lib\\App->exec(Object(stdClass))\n#7 /home/perf/hp3-ph-1015581/856/3607856/user/htdocs/dmxConnect/api/testimonials.php(8): lib\\App->define(Object(stdClass))\n#8 {main}"

I also see the query results when i load your server action in the browser:

https://www.rtmf.org.uk/dmxConnect/api/testimonials.php

Can you send a link to your live page please?

It’s OK its working Teodor. I just uploaded to the live server and its corrected any issues. I guess there was some changes that hadn’t been uploaded to the remote server.

Thanks for your help. And I apologise for being a royal pain in the arse! :grimacing:

1 Like

Remember: the Development target is local, and the Production target is on the live domain.

Thanks @franse … I’ve just found it a bit confusing at first. I think I get it now.