DHTMLXGantt - MYSQL - Can't make changes.


#1

Hi All,

I have an issue where I can read data from a MYSQL DB but writing data back isn’t working. Is anyone able to shed some light on why?

Here is my code in the data.php file:

include (‘codebase/connector/gantt_connector.php’);
$dbtype = “PDO”;
$res = new PDO(“mysql:host=localhost;dbname=gantt”, “root”, “************”);
$gantt = new JSONGanttConnector($res,$dbtype);
$gantt->render_links(“gantt_links”,“id”,“source,target,type”,"");
$gantt->render_table(“gantt_tasks”);

and here is the table layout:

CREATE TABLE gantt_tasks (
id int(11) NOT NULL AUTO_INCREMENT,
start_date datetime NOT NULL,
duration int(11) NOT NULL DEFAULT 0,
progress float NOT NULL DEFAULT 0,
parent int(11) NOT NULL,
user int(11) NOT NULL,
open BOOLEAN DEFAULT NULL,
text varchar(255) NOT NULL,
PRIMARY KEY (id)
);


#2

You need to use the dataprocessor component:
docs.dhtmlx.com/dataprocessor__index.html


#3

Thanks for the reply.
I use the below in my client frontend. Is this correct use of dataprocessor?

gantt.load('data.php');
var dp=new gantt.dataProcessor("data.php");  
dp.init(gantt);

#4

Your server-side code looks well.
Could you please, share a demo link, where the problem can be reconstructed.


#5

Hi Sematik,

Please find below a demo copy.
partbandc.com:6781/index.php


#6

Note: DHTMLXGantt appears to have misread the dates so you’ll have to ‘Zoom’ to see the data.


#7

Your provided link requires the authentication.
Could you please, open ticket at support.dhtmlx.com and provide a required info to reconstruct the problem


#8

Would love to but am using the free tier product - at least at the moment.
Thanks anyway!


#9

BTW, I got the earlier link working with Anonymous Auth if still useful.


#10

Your data2.php request returns the empty json and the 500 error.
While your data.php returns a valid json.