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
v1.7
2011-09-23 22:03:15 -07:00
Sergey Tsalkov
80cc78edcd
insertUpdate() can now handle a second array for the update component, or nothing, so it'll
...
re-use the insert array for the update component
2011-09-23 21:29:40 -07:00
Sergey Tsalkov
5050205e58
add insertUpdate() function for "insert ... on duplicate key update" behavior
2011-09-23 19:15:41 -07:00
Sergey Tsalkov
9f3aa571dc
add some simple tests for the WhereClause system, which will now be official and documented
2011-09-23 18:44:34 -07:00
Sergey Tsalkov
a2800ef04b
add insertIgnore() function -- pretty self explanatory
2011-09-23 16:11:10 -07:00
Sergey Tsalkov
164c7157a6
queryRaw() will now be officially supported, returns mysqli_result instead of array of assoc
...
arrays
2011-09-23 15:57:36 -07:00
Sergey Tsalkov
f09308a3f7
re-organize test files, make it easy to test for both php 5.2 and 5.3
2011-09-23 15:51:35 -07:00
Sergey Tsalkov
69bfe15ebb
add test case regarding BLOBs
2011-08-25 23:54:52 -07:00
Sergey Tsalkov
7621b50a02
handle non-sql errors (such as failure to connect to MySQL server) in a user-defined way
...
adds DB::$nonsql_error_handler and DB::$throw_exception_on_nonsql_error
2011-08-25 23:34:37 -07:00
Sergey Tsalkov
4122fe52c1
collapse some redundant code into a function
2011-06-02 18:57:46 -04:00
Sergey Tsalkov
8072f6ab07
use static class variable, not static function variable, to hold mysql connection
2011-06-01 17:30:28 -04:00
Sergey Tsalkov
860da8d18a
insert(), replace(), and update() now handle the value NULL correctly
2011-05-31 21:50:24 -04:00
Sergey Tsalkov
0ed2837f3d
on second thought, we won't have insertMany() and replaceMany(), but insert() and replace()
...
will figure out which one you mean
this means that a minor undocumented feature, being able to insert an array and have it
automatically serialized, can't exist anymore
v1.6
2011-04-29 01:48:27 -04:00
Sergey Tsalkov
65cae974c5
remove unused variable
2011-04-28 18:51:53 -04:00
Sergey Tsalkov
96892fa6c2
DB::$param_char can now be used to change the char that needs to appear in front of params (% is the default)
2011-04-28 18:41:13 -04:00
Sergey Tsalkov
ad4889da09
revert last commit -- this is a bad way to do it, and I'll have to come up with something else
...
to let people use strings like %i in their SQL and bypass the parser
2011-04-28 18:14:59 -04:00
Sergey Tsalkov
12604d7854
bugfix: let people have literal %'s in their queries without confusing the parser
...
by using %% instead
2011-04-23 20:31:18 -04:00
Sergey Tsalkov
8c5299c2e2
* add insertMany() and replaceMany() to let you do multiple inserts in one SQL command
...
* error and success handlers can now be set to static and object methods
2011-04-23 00:46:51 -04:00
Sergey Tsalkov
964a36e4c2
sqleval() can now be used with %s, %i, and all that good stuff
...
there is probably no good reason to do this, as things like md5() can be done
from PHP, but people keep asking for it, so here it is :)
2011-04-22 23:29:09 -04:00