Merge branch 'master' of github.com:mevdschee/php-crud-api

This commit is contained in:
Maurits van der Schee 2017-10-22 16:39:35 +02:00
commit 0a1c6ea6d6
2 changed files with 6 additions and 1 deletions

View file

@ -2419,6 +2419,9 @@ class PHP_CRUD_API {
echo '"200":{';
echo '"description":"An array of '.$table['name'].'",';
echo '"schema":{';
echo '"type": "object",';
echo '"properties": {';
echo '"'.$table['name'].'": {';
echo '"type":"array",';
echo '"items":{';
echo '"type": "object",';
@ -2451,6 +2454,8 @@ class PHP_CRUD_API {
}
echo '}'; //properties
echo '}'; //items
echo '}'; //table
echo '}'; //properties
echo '}'; //schema
echo '}'; //200
echo '}'; //responses

View file

@ -37,7 +37,7 @@ switch ($method) {
case 'POST':
$sql = "insert into `$table` set $set"; break;
case 'DELETE':
$sql = "delete `$table` where id=$key"; break;
$sql = "delete from `$table` where id=$key"; break;
}
// execute SQL statement