Sergey Tsalkov
15f40efe5d
add DB::queryWalk() -- still untested
...
add DB::lastQuery() (with tests)
2021-06-24 03:05:46 +00:00
Sergey Tsalkov
30f3d9454a
DB::debugMode() is now deprecated (but still works)
...
recommended debug system will use $logfile to log SQL to a file
2021-06-23 21:23:20 +00:00
Sergey Tsalkov
dc21f646af
DB::$logfile can be used to log all queries to either a resource or a file
...
DB::debugMode() is now a shorthand for "DB::$logfile = STDOUT"
2021-06-23 03:05:22 +00:00
Sergey Tsalkov
50fd6ed6d2
actually bring back deprecated methods, keep them for now to maintain backwards compatability
2021-06-23 01:27:03 +00:00
Sergey Tsalkov
6487873c68
new hook-based system for inserting callbacks to run before and after a query
...
debugMode() now works through the new system
2021-06-22 06:01:28 +00:00
Sergey Tsalkov
ac626b0795
simplify parser a bit
2021-06-20 20:53:31 +00:00
Sergey Tsalkov
bac5503d5a
PHP 8 complains when trying to access closed $mysqli object, not sure how to test this properly
...
I don't think we need this test very much, anyway
2021-06-20 03:13:11 +00:00
Sergey Tsalkov
42894b70ae
re-design query parser, new model has cleaner code and allows for %% escaping of % characters
2021-06-20 03:12:15 +00:00
Sergey Tsalkov
20c7acd8a4
DB::parse() lets you generate queries without running them
2021-06-20 02:32:56 +00:00
Sergey Tsalkov
c0f3a7f31d
restore to working in PHP 5.3
2021-06-20 02:32:56 +00:00
Sergey Tsalkov
1d2ad974f8
drop deprecated methods:
...
queryOneRow (alias of queryFirstRow)
queryOneList (alias of queryFirstList)
queryOneColumn
queryOneField
2021-06-20 02:32:56 +00:00
Sergey Tsalkov
2ea4c4c539
__callStatic() should have proper exception thrown if invalid method is used
2021-06-20 02:32:56 +00:00
Sergey Tsalkov
7c1f9bc226
DB::$usenull is removed, it makes no sense in a modern PHP context
2021-06-20 02:32:56 +00:00
Sergey Tsalkov
dab71efacd
DB::columnList() now returns details
2021-06-20 02:28:26 +00:00
Sergey Tsalkov
38545ddb3a
remove more PHP 5.2 cruft, we now require PHP 5.3+
2021-06-20 02:28:26 +00:00
Sergey Tsalkov
0fb0071314
use __callStatic() to clean up code a bit
...
next release will require PHP 5.3+ (up from 5.2)
2021-06-20 02:26:21 +00:00
Sergey Tsalkov and GitHub
03ff51a997
fix composer.json
...
packagist demands lowercase package names now
2021-01-23 22:27:10 -06:00
Sergey Tsalkov and GitHub
4ff57845e4
Update README.md
...
Remove old broken link.
2020-07-11 10:23:08 -05:00
Sergey Tsalkov
e8c19ca2f8
clean up update() and delete(), both will now be compatible with named and numbered arguments
...
resolves #54
2020-07-10 01:13:31 +00:00
Sergey Tsalkov
fa46824df1
get_class_vars() is broken in PHP 7.4 with opcache enabled, so stop using it
...
looks like this fix actually works with PHP 5.2 after all, so not dropping backwards compatibility
resolves #64
2020-07-10 00:00:27 +00:00
Sergey Tsalkov
226a08611f
small test fix to pass on PHP 7.3
2020-07-09 19:51:28 +00:00
Sergey Tsalkov
18d9ab2337
make sure insertOrReplace() gets valid input, throw an error if it doesn't
2020-01-27 08:45:36 -08:00
Sergey Tsalkov
027681b350
bugfix: strtolower() doesn't work with certain locales, so work around that
2020-01-24 15:42:43 -08:00
Sergey Tsalkov and GitHub
677d5659bb
Update README.md
2019-01-26 11:46:13 -06:00
Sergey Tsalkov and GitHub
621f2e7a86
Update README.md
2019-01-26 11:45:50 -06:00
Sergey Tsalkov and GitHub
6e1c252702
Update README.md
2019-01-26 10:23:50 -06:00
Sergey Tsalkov
8e19d9d6c3
bugfix in WhereClause: negate didn't wrap multiple clauses in extra parens
...
Fixes #41
2017-10-15 19:10:35 +00:00
Sergey Tsalkov
22e49b280e
clarify that project is LGPLv3
2017-10-15 18:20:37 +00:00
Sergey Tsalkov
b41887505d
fix to last commit
2017-10-15 17:56:10 +00:00
Sergey Tsalkov and GitHub
aabc77b116
Update README.md
2016-11-21 17:01:59 -08:00
Sergey Tsalkov
8bef6d6618
fix bug with hhvm
2015-03-04 00:43:54 +00:00
Sergey Tsalkov
da46a1eacc
DB::insert() and the like should use __toString() value for objects whenever possible
2014-11-27 01:30:42 +00:00
Sergey Tsalkov
076a7e2b9b
oops
2014-10-27 02:02:32 +00:00
Sergey Tsalkov
67b24c916d
additional test with %li0
2014-10-27 02:00:21 +00:00
Sergey Tsalkov
29c8e42a09
escape and sanitize could be occasionally useful as public functions
2014-10-27 02:00:21 +00:00
Sergey Tsalkov
6fdcffab24
few minor cleanups to last commit
2014-10-27 02:00:21 +00:00
Sergey Tsalkov
e0660a9368
%? no longer handles arrays and hashes for security purposes
...
those are moved into %l?, %ll?, %hc, %ha, %ho for different uses
2014-10-27 02:00:21 +00:00
Sergey Tsalkov
0474a41a56
functions generally shouldn't keep going after a nonsql error
2014-10-27 02:00:21 +00:00
Sergey Tsalkov
1fe2fdea16
when an instance of MeekroDB is created, its default settings will be those of the static instance
2014-10-27 02:00:20 +00:00
Sergey Tsalkov
83256937b8
make some useful functions public
2014-08-25 20:20:39 -07:00
Sergey Tsalkov
eb36858f1a
columnList() properly escapes table names
2014-06-16 22:40:22 +00:00
Sergey Tsalkov
1d797b306e
bugfix: insert/update type functions don't break when using a param_char other than %
2014-06-14 02:41:06 +00:00
Sergey Tsalkov
7c819bfc24
the connect_options variable lets you set mysqli_options, like a connection timeout
2014-06-14 01:58:51 +00:00
Sergey Tsalkov
1d147e169a
ssl support (still untested)
2014-06-14 01:31:32 +00:00
Sergey Tsalkov
391702700d
clean up static class init syntax a bit
2014-06-14 01:06:05 +00:00
Sergey Tsalkov
37fd169be3
minor bugfix: don't assume that the query results for queryFirstRow() or queryFirstList() will be an array (can also be a bool)
2014-06-14 00:27:38 +00:00
Sergey Tsalkov
7c5c03c576
minor cleanups
2014-06-13 21:19:10 +00:00
Sergey Tsalkov
a0a2f702e2
bugfix: don't crash if nested transactions are enabled, and the first command issued is a start transaction
2014-03-31 01:50:10 -07:00
Sergey Tsalkov
2707bcba7d
minor bugfix: don't drop identical query components in WhereClause (thanks Alexander!)
2013-12-06 11:17:54 -08:00
Sergey Tsalkov
7b0da839de
add yet another test for this weird bug people are reporting
...
tests *still* all pass, I can't reproduce the bug
2013-11-08 14:14:46 -08:00
Sergey Tsalkov
1d51c2b674
add additional test case for a reported bug where '%s' in data is parsed as a query placeholder
...
I can't reproduce the bug
2013-09-13 22:36:33 -07:00
SergeyTsalkov
de63573e98
Merge pull request #14 from bcash/master
...
Added passthru of mysqli error code to MeekroDBException object
2013-06-30 01:31:12 -07:00
Sergey Tsalkov
e403c774c8
Merge branch 'master' of github.com:SergeyTsalkov/meekrodb
2013-06-21 16:27:25 -07:00
Sergey Tsalkov
740ca7bc67
restore %ss to working, add unit test so it won't break again
2013-06-21 16:27:05 -07:00
SergeyTsalkov
7563c660ad
Update readme to include brief installation section
2013-06-09 17:08:20 -06:00
Sergey Tsalkov
3741291f44
add a few more fields to composer.json
2013-06-08 13:55:16 -07:00
Sergey Tsalkov
7e00296b32
add license to composer file
2013-06-08 13:38:26 -07:00
Sergey Tsalkov
e2e95adda2
composer fix
2013-06-08 13:32:01 -07:00
Sergey Tsalkov
34a3de3f84
add composer.json for composer support -- not yet tested
2013-06-08 13:28:27 -07:00
Sergey Tsalkov
cc8dbe47eb
%i should allow big ints on 32 bit systems
2013-06-07 00:03:30 -07:00
SergeyTsalkov
8090f4e7dc
Update README.md
2013-06-05 00:19:36 -07:00
SergeyTsalkov
58e564c3d5
Update README.md
2013-06-05 01:08:41 -06:00
Sergey Tsalkov
253e803160
WhereClause can't have a __toString() method anymore because of how it's handled in combinatino with preparseQueryParams() now
2013-06-05 00:01:10 -07:00
SergeyTsalkov
c05a575be0
Create README.md
2013-06-05 01:01:08 -06:00
Sergey Tsalkov
e61d66fdf8
new DateTime() can be used with insert-like commands, and with %? as well
2013-06-02 19:45:44 -07:00
Sergey Tsalkov
e9a55de0b4
DB::$usenull param can be used to decide whether insert()-like commands insert NULL or empty string for NULL
2013-06-02 19:22:14 -07:00
Sergey Tsalkov
9e4cbc28c1
%t and %lt variables can be used to hold a datetime, which will be formatted to mysql standards
2013-06-02 19:10:28 -07:00
Sergey Tsalkov
b6397a719c
merge freeResult and checkError functions back into queryHelper() since they're only used once
2013-06-02 18:17:59 -07:00
Sergey Tsalkov
65ec35c591
modify WhereClause to hold off on evaluating parameters
...
preparseQueryParams will now receive full WhereClause object and evaluate there
2013-06-02 15:51:58 -07:00
Sergey Tsalkov
1d61a11098
add %? autodetection parameter, simplify functions such as insert() and update() to rely on it
2013-06-02 15:17:14 -07:00
Sergey Tsalkov
ecd5fe190f
clean up query parsing code -- will be necessary for transition to prepared statement approach
2013-06-02 12:52:04 -07:00
Sergey Tsalkov
e94f75fe2a
DB::disconnect() allows easy disconnecting from mysql
2013-03-19 12:02:47 -07:00
Sergey Tsalkov
ce11e65070
successful insert/replace/update/delete will return true
2013-03-19 11:31:50 -07:00
Sergey Tsalkov
6cb757797b
minor fix for calculated columns with fullcolumns
2013-03-19 11:20:20 -07:00
Sergey Tsalkov
027e1529ba
create DB::queryFullColumns() which will supply full column names in the format table.column
2013-02-22 22:11:27 -08:00
Sergey Tsalkov
e03ac71b45
more organization and simplification
...
add queryAllLists() and queryRawUnbuf() methods
2013-02-22 21:28:41 -08:00
Sergey Tsalkov
f89d70e49e
bugfix: can use null value for named or numbered parameters
2013-02-22 16:32:15 -08:00
Sergey Tsalkov
6babe98b11
bugfix: free any extra results so CALL commands don't fail
2013-02-22 16:18:18 -08:00
Sergey Tsalkov
039468f3a3
more cleanups and remove old and unused code
2013-02-22 15:08:08 -08:00
Sergey Tsalkov
5e9507181f
code cleanups
2013-02-22 12:37:11 -08:00
Sergey Tsalkov
7364df36cf
include a formatting error if they pass an array where we're not expecting one
2013-02-22 11:52:18 -08:00
Sergey Tsalkov
7df5c9baa2
update copyright year
2012-09-20 21:05:19 -07:00
Sergey Tsalkov
ed347e841a
verticalslice and reindex cleanups and tests
2012-09-20 20:50:05 -07:00
Sergey Tsalkov
2ffb770f8a
bugfix: don't fail when inserting multiple rows at once, and one of the values is NULL
2012-09-19 14:58:09 -07:00
Sergey Tsalkov
ed9c29fe49
add DB::transactionDepth() for checking how many transactions are active
...
when not using nested transactions, will return 1 or 0
2012-09-18 21:08:28 -07:00
Sergey Tsalkov
9a41bf34a1
a few nested transaction cleanups
...
functionality for committing/rolling back all active transactions
2012-09-18 20:54:39 -07:00
Sergey Tsalkov
24c1b930df
add DBHelper class with functions verticalSlice and reIndex
2012-09-18 20:13:43 -07:00
Sergey Tsalkov
d40bc57dde
add nested transactions (mysql >= 5.5 only)
2012-09-18 19:08:37 -07:00
Sergey Tsalkov
c62fc187ee
quick testing change
2012-09-09 17:31:57 -07:00
Sergey Tsalkov
6b324d1291
using $where is now equivalent to $where->text()
2012-09-09 14:49:43 -07:00
Sergey Tsalkov
5b4e5a959a
fix named parameters
2012-07-22 17:43:34 -07:00
Sergey Tsalkov
7582961ee1
named parameters for queries
2012-07-22 17:29:59 -07:00
Sergey Tsalkov
2d49f4f350
remove backtrace from default error message -- it can leak private information
2012-07-08 13:04:57 -07:00
Sergey Tsalkov
9930fc073a
restore %lb parameter to working, add unit test so it doesn't break again
2012-02-03 17:19:54 -08:00
Sergey Tsalkov
788c506f16
success handler gets "affected" var for affected rows
2012-01-25 13:59:42 -08:00
Sergey Tsalkov
bbf9534326
add execution time to tests
2011-12-24 17:27:53 -08:00
Sergey Tsalkov
1d5844bcc0
major redesign to enable multiple instances via "new MeekroDB()" while preserving full backwards
...
compatability
static methods DB::whatever() will still be the recommended method of use, but the new object oriented
approach is now available to those who want it
2011-12-24 16:12:13 -08:00
Sergey Tsalkov
34c0f5e0a7
add E_STRICT to tests
2011-12-24 13:07:44 -08:00
Sergey Tsalkov
7825f90080
can now refer to a specific argument in a query
...
e.g. %s2 for the third argument, taken as a string
2011-12-17 19:54:55 -08:00
Sergey Tsalkov
a1f01a4f87
few more fixes and tests for WhereClause
2011-09-23 22:03:15 -07:00