Page 1 of 2

No data retrieved from mysql

Posted: Thu Jan 16, 2020 9:17 am
by jjhoog8
Hi,

I am using a Synology NAS as a webserver.
Details:
Synology DS216 II
MariaDB 10 (Mysql database) port 3306 (default)
Apache http server 2.4
PHP7.3
PHP7.2
PHP5.6
Wordpress
Webstation
Webserver runs ok,

When I connect to the Synology I use the following connection information:
Database source MySQL (online)
MySQL server 192.168.1.19
MySQL Database Briefing
MySQL Username GEZC
MySQL Password xxxxx
MySQLTable Instructeurs

After publishing the whole site to the Synology:
No errors, but no data

response is : \n";foreach($row as $cell) {echo "\n';} echo "\n";}?
Column1 Column2 Column3
".$cell."

What is wrong?
Al the connection parameters are correct I use them for another application to.
The user GEZC has all rights.
Connecting with user root gives the same problem.

Thanks in advance

Re: No data retrieved from mysql

Posted: Thu Jan 16, 2020 11:15 am
by Pablo
It looks like the page extension is not set to PHP.

Re: No data retrieved from mysql

Posted: Fri Jan 17, 2020 7:27 am
by jjhoog8
Hi Pablo

When i set the page to php and publish the site i get only the html code including php code. But no results from the table

Re: No data retrieved from mysql

Posted: Fri Jan 17, 2020 8:09 am
by Pablo
Maybe PHP is not installed on the server?

Re: No data retrieved from mysql

Posted: Fri Jan 17, 2020 3:40 pm
by jjhoog8
Hi
Php is installed
W***p***s needs it too. W**d***s is up and running
And another tool i use is PHPRad, this tool makes php pages only
Both applications are running on my synology webserver.

Re: No data retrieved from mysql

Posted: Fri Jan 17, 2020 4:26 pm
by Pablo
In that case, the server should not send the PHP to the browser.

Re: No data retrieved from mysql

Posted: Fri Jan 17, 2020 5:26 pm
by jjhoog8
Hi Pablo

Could the problem be on the Maria10 db?
It should support Msqli.

Re: No data retrieved from mysql

Posted: Fri Jan 17, 2020 6:04 pm
by Pablo
I'm sorry, I am not familiar with Maria DB so I cannot help you with that.
However, the server should never send PHP code to the browser.

Re: No data retrieved from mysql

Posted: Fri Jan 17, 2020 10:51 pm
by MGD4me
After publishing the whole site to the Synology:
No errors, but no data

response is : \n";foreach($row as $cell) {echo "\n';} echo "\n";}?
Column1 Column2 Column3
".$cell."

What is wrong?
First... the above only shows part of the code necessary to get data from the database.

Immediately prior to the response above, does your SQL code include a statement with " SELECT * FROM Instructeurs", etc ??

I would suggest using a tool such as phpMyAdmin to determine if your 'Briefing' database even has data stored in the 'Instructeurs' table.

Re: No data retrieved from mysql

Posted: Sun Jan 19, 2020 10:16 am
by jjhoog8
Hi

I use phpMyAdmin
The table is filled with 32 records
And in the code has the select statement

Re: No data retrieved from mysql

Posted: Sun Jan 19, 2020 10:40 pm
by MGD4me
I use phpMyAdmin
The table is filled with 32 records
And in the code has the select statement
Without seeing your actual code, it would be difficult for anyone to guess what the issue might be. You are seeking standard SQL support, which unfortunately has nothing to do with the WWB program itself, so support from this forum might be limited.

If you are writing your own code, you might try something like: https://www.w3schools.com/php/func_mysqli_query.asp

Or...

You could try the 'Dataviewer' extension, which will retrieve data for you by simply entering your credentials into the configuration. It comes with a PDF 'Help' document to guide through the process. It states:

Data Viewer can display data from CSV files, a MS Access database or MySQL tables.
The data will be displayed in a table which can be sorted and paginated by the user without the need to refresh the whole page!
The appearance of the table is very customizable and has several cool options like alternate row colors and sorted column highlighting.

Re: No data retrieved from mysql

Posted: Fri Jan 24, 2020 11:46 am
by jjhoog8
Hi

Thanks for your reply
I have the data extension installed. But the same problem.
In between i found the problem
Mariadb is standard not allowed for remote connections
I have to change the my.cnf file of the mariadb on my Synology
I let you know after the change if the problem is solved

Re: No data retrieved from mysql

Posted: Fri Jan 24, 2020 5:39 pm
by MGD4me
Mariadb is standard not allowed for remote connections
That is a normal security practice. Thanks for letting us know that you got it working!!

Re: No data retrieved from mysql

Posted: Sat Jan 25, 2020 4:05 pm
by jjhoog8
Hi
The wysywig builder has the paid extension tables installed. Not the demo version.
I use the dutch version of wysiwyg builder 15

The generated php code from the extension I paste it into a separate php file
It runs well directly in the browser. Localhost/test.php.
I get the records back. So the mariadb connection is working, the phpcode from the extension is working
Rest only 1 problem.
Publishing from Wysiwyg builder gives no records
Page extension on php
documenttype on HTML 5
The result is the complete page code.
When I save this code in a php file it runs correct in the browser. I get the records back

I looked into the map and see that wysiwyg writes a html file and not a php file
Regardless of the page setting extension on php
What do I wrong?
Or is it maybe a bug in the dutch version of wysiwyg?

I hope we can solve together this final problem.
Thanks in advance for all your help

Re: No data retrieved from mysql

Posted: Sat Jan 25, 2020 4:23 pm
by Pablo
The dutch version is 100% the same as the English version. Only the selected language is different.

Maybe the configuration is wrorng?