06-06-2017, 01:31 PM
EDIT: I've changed this topic to be a list of things I've added instead of just about one function.
====
https://pastebin.com/Jp2EbDTw
Based on the version by @plb . My changes to his code are listed there.
30 - charset=utf8 added because of this issue
50 - results are cleaned before every query
195 - delete() won't work if argument is empty
204-221 - insert() can add multiple records
202, 223-232 - added optional argument for insert() so that it can update records on duplicate id
238 - column names are wrapped in grave accents in update()
239-252 - optionally condition array may be passed to update() instead of record id
265 - added optional argument for first() which works in the same way as for results() (aka returns array instead of an object). Also if there are no results the function will return empty array.
300-309 - added cell() for getting single field out of first record
====
https://pastebin.com/Jp2EbDTw
Based on the version by @plb . My changes to his code are listed there.
30 - charset=utf8 added because of this issue
50 - results are cleaned before every query
195 - delete() won't work if argument is empty
204-221 - insert() can add multiple records
202, 223-232 - added optional argument for insert() so that it can update records on duplicate id
238 - column names are wrapped in grave accents in update()
239-252 - optionally condition array may be passed to update() instead of record id
265 - added optional argument for first() which works in the same way as for results() (aka returns array instead of an object). Also if there are no results the function will return empty array.
300-309 - added cell() for getting single field out of first record