Failed to load resource: the server responded with a status

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

…contacts.php?connector=true&dhx_colls=1,2,7&dhxr=1417691357176

I keep getting this same error, I’ve literally been trying to figure this out for the past 6 hours. I even went through and edited all of the “&dhxr” to “&dhxr=” as another post recommended.

This post: viewtopic.php?f=19&t=38682

There is nothing wrong with the server, MySQL or the database details. It has to either be something that I’ve done wrong with my code (I’ve followed these tutorials to great detail), or it has something to do with an error in dhtmlx’s code, which I doubt as well. So I’m just lost.

All help is appreciated!

Here is a temporary testing url: mrobertsdesign.ca/dhtmlxs_te … lgary.html

[code]<?php
require("…/codebase/connector/grid_connector.php");
$res=mysql_connect("####","####","####");
mysql_select_db("####");

$conn = new GridConnector($res,"MySQL");
$conn->render_table("fname","fstatus","ftype","femail","fphone","fmobile","faddress","fproduct","fdimensions","fscb","fscf","finstalled","flast","next");

?>[/code]

This is my code for the php file

Any ideas?

The client side code is fully valid
You can try to enalbe the server side logging

$conn = new GridConnector($res,"MySQL"); $conn->enable_log("some.txt");

some.txt will contain extra details about connector initialization and all errors

It doesn’t show any errors for me, strange…

I’m not sure what you need from me at this point to figure out what’s going on, can you figure out anything from looking at the test url above?

I’ve tried it on 2 completely different servers, same problem, so it’s not server side. There’s something happening with the code?

Test url is still up for those who would like to see if you can find anything wrong: mrobertsdesign.ca/dhtmlxs_te … lgary.html

Do you have any output in the log file ? It must show at least few lines for any request.
If log files wasn’t created - check the write permissions for the target folder.

As last resort you can try to check php error logs, they must contains details about any php errors.

I’ll take a look when I get home tonight and update this post with the info I find, thanks!

I must have missed something. Just so I know, how do I get the PHP logs?

You need the error.log file.
On linux system it is stored at /var/log/apache
On windows - in log subfolder in the apache’s location.

Took me some time, I’ve been a little busy, but I’ve found it and here it is!

20141212T100804: mrobertsdesign.ca/dhtmlxs_test/data/calgary.php 

PHP Fatal error: Uncaught exception ‘Exception’ with message ‘Incorrect dataset minimization, master field not found.’ in /hermes/bosoraweb111/b2738/ipg.mrobertsdesignca/dhtmlxs_test/codebase/connector/db_common.php:316
Stack trace:
#0 /hermes/bosoraweb111/b2738/ipg.mrobertsdesignca/dhtmlxs_test/codebase/connector/grid_connector.php(205): DataConfig->minimize(NULL)
#1 /hermes/bosoraweb111/b2738/ipg.mrobertsdesignca/dhtmlxs_test/codebase/connector/grid_connector.php(154): GridConnector->fill_collections('1,

Now what do you need to help me fix whatever the problem is??

Thanks!

It seems you have select filters or combo columns in the grid.

Server side attempts to generate the sub-queries to load the list of sub-options, but due to some reasons it can’t do it correctly. To fix the problem use set_options API to directly define the list of options for the related columns

docs.dhtmlx.com/connector__php__ … nswithdata

Okay, we’re getting somewhere!

So if I have this:

mygrid.setHeader("Client Name/Title,Status,Type,Contact Information,#cspan,#cspan,Address,Product,#cspan,Service Cost,#cspan,Date (MM/DD/YYYY),#cspan,#cspan");

mygrid.attachHeader("#text_filter,#select_filter_strict,#select_filter_strict,Email Address,Phone,Mobile,#text_filter,#select_filter_strict,Dimensions,Basic,Full,Installed On,Last Service,Next Contact");

    mygrid.setColumnIds("fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next");

I need to set something like this:

$conn->set_options("item_nm",array("1" => "one", "2" => "two","3" => "three")); 
$conn->render_table("grid50","item_id","item_nm,item_cd");

I’m not asking you to do that for me here, I get that the array is the filter, so what is item_nm?

Right now this is the code:

$conn = new GridConnector($res,"MySQL");
$conn->render_table("fname","fstatus","ftype","femail","fphone","fmobile","faddress","fproduct","fdimensions","fscb","fscf","finstalled","flast","next");

Okay, we’re getting somewhere!
(reposted the exact same post but with better formatting to make it easier, can’t edit posts?)

So if I have this:

[code]mygrid.setHeader(“Client Name/Title,Status,Type,Contact Information,#cspan,#cspan,Address,Product,#cspan,Service Cost,#cspan,Date (MM/DD/YYYY),#cspan,#cspan”);

mygrid.attachHeader("#text_filter,#select_filter_strict,#select_filter_strict,Email Address,Phone,Mobile,#text_filter,#select_filter_strict,Dimensions,Basic,Full,Installed On,Last Service,Next Contact");

mygrid.setColumnIds(“fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next”);[/code]

I need to set something like this:

$conn->set_options("item_nm",array("1" => "one", "2" => "two","3" => "three")); $conn->render_table("grid50","item_id","item_nm,item_cd");

I’m not asking you to do that for me here, I get that the array is the filter, so what is item_nm?

Right now this is the code:

$conn = new GridConnector($res,"MySQL"); $conn->render_table("fname","fstatus","ftype","femail","fphone","fmobile","faddress","fproduct","fdimensions","fscb","fscf","finstalled","flast","next");

Please try to change
$conn->render_table(“fname”,“fstatus”,“ftype”,“femail”,“fphone”,“fmobile”,“faddress”,“fproduct”,“fdimensions”,“fscb”,“fscf”,“finstalled”,“flast”,“next”);

with

$conn->render_table(“fname”,“id”, “fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next”);

You are providing all fields as separate paremeters, while it must be a comma separated list as third parameter. Also, second parameter - must be name of id field for the related table.

As for the original question
For columns where you are using select_filter_strict, server side will try to generate SQL queries to fetch list of options for related columns. You can use set_options command with names of those fields ( one command per field ) to define options for related select lists. ( most probably it will work automatically after the above fix )

This is what I have:
(I didn’t actually write HOSTNAME, USERNAME, PASSWORD and DATABASE, just putting those there for placeholders so people can’t see that info.)

[code]<?php
require("…/codebase/connector/grid_connector.php");
$res=mysql_connect(“HOSTNAME”,“USERNAME”,“PASSWORD”);
mysql_select_db(“DATABASE”);

$conn = new GridConnector($res,"MySQL");
$conn->render_table("fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next");

?>[/code]

I know I need to make that one line something like this:

	$conn->render_table("grid50000","item_id","fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next");

I don’t know where to find my equivalent to “grid50000” and “item_id” though?

“grid50000” is your table name and “item_id” your primary key.

Loewi

Oh, so table name and primary key can be whatever? I was looking in the php for some sort of equivalent. Thanks.

Nothing changed, same issue. But we’re getting somewhere… here is the current log file on the site I’m actually hosting the web app:

[17-Dec-2014 11:01:30 America/Chicago] PHP Strict Standards:  Declaration of GridConnector::fill_collections() should be compatible with Connector::fill_collections() in /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/codebase/connector/grid_connector.php on line 126
[17-Dec-2014 11:01:30 America/Chicago] PHP Fatal error:  Uncaught exception 'Exception' with message 'MySQL operation failed
Table '429406_myccalgary.mygridc' doesn't exist' in /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/codebase/connector/db_common.php:965
Stack trace:
#0 /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/codebase/connector/db_common.php(650): MySQLDBDataWrapper->query('SELECT DISTINCT...')
#1 /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/codebase/connector/db_common.php(674): DBDataWrapper->select(Object(DataRequestConfig))
#2 /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/codebase/connector/base_connector.php(834): DBDataWrapper->get_variants('fstatus', Object(DataRequestConfig))
#3 /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/codebase/connector/grid_connector.php(212): DistinctOptionsConnector->render()
#4 /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/c in /mnt/stor13-wc2-dfw1/422945/429406/www.fountaincreations.ca/web/content/centre/codebase/connector/db_common.php on line 965

Here is my code again:

[code]<?php
require("…/codebase/connector/grid_connector.php");
$res=mysql_connect(“HOSTNAME”,“USERNAME”,“PASSWORD”);
mysql_select_db(“429406_myccalgary”);

$conn = new GridConnector($res,“MySQL”);
$conn->render_table(“mygridc”,“id”,“fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next”);
?>[/code]

So it appears that the table name and primary id are not correct, where can I find those?

Your help is appreciated.

Any idea?