Comments (3)
That's not an issue- please make sure that all numeric values are integer, than it will be running...
--> I recently had exactly the same problem, solved it by setting the variables in php to integer ($foo = (int)$foo).
from pdo_class_wrapper.
Hi tmuks,
Thanks for using Class. You are getting error because of you are using lat, long values without quotes and the values are double/decimal type. PDO has not an PDO::PARAM for decimals/doubles. So, You can change function _bindPdoNameSpace by adding
// is double found then pdo param as string
case 'double':
$this->_oSTH->bindParam( ":s" . "_" . "$f", $array[$f], PDO::PARAM_STR );
break;
in else condition around line number 988.
or you can wrap your values in quotes as given example..
// your insert array data
$dataArray = array(
"user_id" => 2,
"title" => "poodles r us",
"description" => "poodles r us makes u dog happy! NO kennels, just friendly people TO look AFTER your dog WHILE you re away! think OF us friends",
"address" => "slough, slough, slough sl3 8ay, uk",
"latitude" => "51.5006615",
"longitude" => "-0.5303367",
"property_id" => 6,
"outdoor_size" => "medium",
"late_bookings" => 1,
"cancellation_policy" => 1,
"created_date" => "2014-08-19 22:36:23"
);
// execute the insert
$lid = $db->insert('table',$dataArray)->showQuery()->getLastInsertId();
from pdo_class_wrapper.
Thnaks all,
It was the issue with double value
as neeraj suggested I added following to the function _bindPdoNameSpace
//case 'double':
default:
$this->_oSTH->bindParam( ":s" . "_" . "$f", $array[$f], PDO::PARAM_STR );
And really a good class you created, just few minor enhancement required for optimum results
from pdo_class_wrapper.
Related Issues (17)
- wild cards? HOT 1
- Please make a PHP8 code review HOT 3
- [Feature request] Add time elapsed in showQuery
- [Question] Update incremental value HOT 3
- [Feature request] Add more description to debug problems
- [Bug] date format is wrong
- [Feature request] Add support for PDO::PARAM_LOB
- SQLSTATE[08004] [1040] Too many connections HOT 7
- Connect through unix_socket HOT 1
- PHP8 Compatibility
- Insert issue HOT 1
- how can you compare array against string function HOT 3
- Update query is not executing HOT 2
- SQL IN operator HOT 1
- how to write a delete query HOT 5
- Do you have the latest version for PHP7 ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdo_class_wrapper.