Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all articles
Browse latest Browse all 5028

Add record using mysql service with php

$
0
0

I need to add a record using mysql service in a custom php server side script,

i try:
$payload = $event['request']['payload'];
$api = $platform['api'];
$post = $api->post;

$arr = array('id' => 999);
$msg = ['resource' => $arr];

$result = $post('mysql/_table/todo', '{"resource": $arr}');//none of these two rows
$result = $post('mysql/_table/todo', $msg); //seem to be working

My todo table is a single column table, and from the swagger definitions of the mysql service i can add new data with this body successfully,

{"resource": [{"id":789}]}

Thanx in advance


Viewing all articles
Browse latest Browse all 5028

Trending Articles