jQuery UI Widgets › Forums › General Discussions › (NEWBIE) PHP : Binding jqxChart to MySQL Database – Accessing data.php content
This topic contains 5 replies, has 2 voices, and was last updated by Kami 1 year, 3 months ago.
-
Author
-
June 2, 2022 at 9:20 am (NEWBIE) PHP : Binding jqxChart to MySQL Database – Accessing data.php content #121774
Hi,
I am experimenting with binding a jqxChart to a MySQL Database using PHP, as explained here :
https://www.jqwidgets.com/jquery-widgets-documentation/documentation/phpintegration/php-server-side-chart-binding.htmIn data.php, I am able to print out the json content of $orders through :
echo json_encode($orders);
However, data.php is not properly called in index.php so that my index.php page remains blank.
Do you know what I could be doing wrong ?
Thanks a lot for your time and patience.
K.
- This topic was modified 1 year, 4 months ago by Kami.
June 2, 2022 at 10:30 am (NEWBIE) PHP : Binding jqxChart to MySQL Database – Accessing data.php content #121776Hi Kami,
What is the folder structure of your project?
If data.php and index.php are in different folders then you need to specify the correct url to data.php in index.phpAlso, each browser has a Network tab where you can check if the file was found and what content it returned.
In Google Chrome it is opened with ctrl + shift + j -> NetworkBest regards,
Ivan Peevski
jQWidgets Team
https://www.jqwidgets.comJune 2, 2022 at 12:15 pm (NEWBIE) PHP : Binding jqxChart to MySQL Database – Accessing data.php content #121779Hi Ivan,
thanks for your answer.
data.php and index.php are in the same folder.
(I have not modified the original files structure after having registered and downloaded all your demo examples.)
Firefox network tab shows me that all jQuery .js and .css files are correctly called except data.php .
Do you know where the problem could lie ?
Thanks.
K.
June 2, 2022 at 12:58 pm (NEWBIE) PHP : Binding jqxChart to MySQL Database – Accessing data.php content #121782Hi Ivan,
I tried the following URLs :
url: ‘data.php’ <!– as in your documentation –>
url: ‘../../demo/PHP/bind_chart_to_mysql_database/data.php’
url: ‘http://localhost/jquery-ui/demos/PHP/bind_chart_to_mysql_database/data.php’
url: ‘jquery-ui/demos/PHP/bind_chart_to_mysql_database/data.php’
url: ‘demos/PHP/bind_chart_to_mysql_database/data.php’
url: ‘PHP/bind_chart_to_mysql_database/data.php’
url: ‘bind_chart_to_mysql_database/data.php’None of them worked.
Could you point me in the right direction ?
Thanks.
K.
K.
June 3, 2022 at 12:00 pm (NEWBIE) PHP : Binding jqxChart to MySQL Database – Accessing data.php content #121790Hi Kami,
When you said that index.php remains blank, can you please specify if really the whole index.php remains blank or just the chart is empty?
If the whole page is blank, this means that not all scripts are loaded correctly and the problem is not in data.php. You can try changing the url of the script files like so:
<script type=”text/javascript” src=”../../../jqwidgets/jqxcore.js”></script>If there is an empty chart, this means that the problem is in data.php. When you open the Network tab, what code do you receive for data.php? Is it 404(not found) or 200(OK)? If it is 200, what is the exact content of the file?(you can check that by clicking the file -> Response)
Best regards,
Ivan Peevski
jQWidgets Team
https://www.jqwidgets.com- This reply was modified 1 year, 3 months ago by ivanpeevski.
June 3, 2022 at 1:55 pm (NEWBIE) PHP : Binding jqxChart to MySQL Database – Accessing data.php content #121792Hi Ivan,
Thanks for your help, the extra forward slash was missing.
(I am going to properly rearrange my files/folders structure in the future, just after I am done testing jqwidgets as a whole.)
Best Regards,
Kâmi Barut
-
AuthorPosts
You must be logged in to reply to this topic.