You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #0 the problem is shown: the quote() method got an integer called in generate().
The value 33427 is a value in a databes column "size" which has type "int".
In the source of generate() the value PDO::PARAM_STR seems to catch integer values. In generate the integer values must be handled before a string - or the qote() method must detect an integer.
My fast fix was adding a test is_integer($value[1]) in the generate() method before handling strings.
I dived a bit deeper into what happens in the generate() method. Its 2nd param $map comes from $log of executed queries.
There is a helper method Medoo\Medoo::typeMap().
I added a line debug code in to see my values of the query in typeMap() while adding an indexed website into the database (= the values of the given insert in the 1st posting). echo __METHOD__."(".(is_string($value)? substr($value, 0, 20) : $value ).", $type)\n";
shows me
Information
Describe the Problem
After migrating from 1.x to 2.1,2 the method last() does not work (in my app) anymore. It occurs on PHP 7.4 and 8.0.
Detail Code
after an insert (it was successful) I use
echo $oDB->last();
In #0 the problem is shown: the quote() method got an integer called in generate().
The value 33427 is a value in a databes column "size" which has type "int".
In the source of generate() the value PDO::PARAM_STR seems to catch integer values. In generate the integer values must be handled before a string - or the qote() method must detect an integer.
My fast fix was adding a test
is_integer($value[1])
in the generate() method before handling strings.Expected output
Get a string with last query.
The text was updated successfully, but these errors were encountered: