Uncategorized

CURL post api json

+Create: curl -H “Content-Type: application/json” -X POST -d ‘{“name”:”xyz”,”description”:”xyz”,”price”:”3232″,”category_id”:”1″}’ http://localhost/restApi/api/product/create.php   + Update: curl -H “Content-Type: application/json” -X POST -d ‘{“id”:”69″,”name”:”xxx”,”description”:”lol”,”price”:”121212″,”category_id”:”1″}’ http://localhost/restApi/api/product/update.php + DELETE: curl -H “Content-Type: application/json” -X POST -d ‘{“id”:”69″}’ http://localhost/restApi/api/product/delete.php + SEARCH with get TYPE: curl -H “Accept: application/json” -X GET ‘http://localhost/restApi/api/product/search.php?s=zzz’ Advertisements

Uncategorized

mysql how to ignore error doesn’t have a default value

This is caused by the STRICT_TRANS_TABLES SQL mode defined in the MySQL my.ini file. Removing that setting and restarting MySQL should fix the problem, or, get into the mysql command and: select @@GLOBAL.sql_mode +——————————————–+ | @@GLOBAL.sql_mode | +——————————————–+ | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | +——————————————–+ 1 row in set (0.00 sec) Then do: mysql> set GLOBAL sql_mode=’NO_ENGINE_SUBSTITUTION’;