PHP -> NodeJS
PHP -> NodeJS
Freedy
Posts: 33Questions: 5Answers: 0
Hi,
I'm converting a project from PHP to NodeJS, in PHP I'm passing a variable to PHP how do I do this in node?
JS side:
editor = new $.fn.dataTable.Editor( {
ajax: {
url: 'php/table.MuffinLift.php',
type: 'POST',
data: function ( d ) {
d.WorkOrder = JobNumber;
}
},
PHP side:
->debug( false )
->where( 'MuffinLift.JobNumber', $_POST['WorkOrder'])
->process( $_POST )
->json();
This discussion has been closed.
Replies
The NodeJS documentation for Editor shows how you can use its
where
conditions.Depending on the Node framework you are using the parameters are usually in
req.body.WorkOrder
, but you'd need to refer to the documentation for whatever framework you are using to confirm that.Allan
Hi,
I've converted my PHP to Node.JS, the value entered from a bubble edit are
not being sent to my Node server. In the server I can see the value entered in the
values['MuffinLift']['PartsCut'] field. When I look in my data sent to the server:
data: [{DT_RowId: "row_1782",…}]
0: {DT_RowId: "row_1782",…}
DT_RowId: "row_1782"
MuffinLift: {ID: 1782, JobNumber: 8200, category: "Frame", part_name: "BACK PartsCut: 0
PartsCut always is zero. The PHP version works fine.
Any suggestion?
I'd need a link to a page showing the issue and also be able to see your NodeJS code please?
Thanks,
Allan
Hi,
Here is my NodeJS, I won't be able to do a linked page.
Thanks.
muffinlift
in the constructor andMuffinLift
in the list of fields. I'm not sure that will be the issue, but it would be the first thing to check. Make it all consistent with how your database is setup.Allan
Thanks, that was the problem.
Thanks again.