Get KoolPHP UI with 30% OFF!

PDODataSource.php + ms sql

Paulo
Hello,
1. in order to be able to insert record in mssql using PDO had to change this file:
//pofa comented $_insert_commands[$i] = preg_replace("/(@".$_key.")([\)\'\"]*[\s;,])/",preg_quote(addslashes($_value))."$2",$_insert_commands[$i]);
//pofa comented $_insert_commands[$i] = preg_replace("/(@".$_key.")([\)\'\"]*$)/",preg_quote(addslashes($_value))."$2",$_insert_commands[$i]);
$_insert_commands[$i] = preg_replace("/(@".$_key.")([\)\'\"]*[\s;,])/",$_value."$2",$_insert_commands[$i]);
$_insert_commands[$i] = preg_replace("/(@".$_key.")([\)\'\"]*$)/",$_value."$2",$_insert_commands[$i]);
both update and insert functions
1.1 example: koolgrid reads a number "45.0" , writes "45\.0" and ms sql does not like it ans issues error "data type conversion" (took me 4hours to find it)
1.2 please advise if what i'm doing is correct
2. the lack of debugging tools on the sql classes is troublesome
2.1 on errors you should pass a message to the UI
2.2 had to :
//grid data sources
$conn =new PDO (DATABASECONNECT,DATABASEUSER,DATABASEPWD);
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
$ds = new PDODataSource($conn);
2.3 and had again to change PDODataSource.php:
foreach($_insert_commands as $_insert_command)
{
error_log($_insert_command); //pofa
$_st_id = $this->_PDO->prepare($_insert_command);
.....
2.4 since this is an overwritable file on future upgrade, these hacks are not advisale
2.5 please add a way we can debug the sql queries properly
--
Paulo Ferreira
Posted Feb 28, 2017 , edited Feb 28, 2017 Kool -
Jamiel
Un soir je cherchais quelque chose de différent à faire, sans me compliquer la vie. C’est comme ça que je suis tombé sur spin mama casino. Ils proposent des bonus dédiés à la France, avec des tours gratuits sur plusieurs machines populaires et des offres qui augmentent ton dépôt quand tu veux prolonger un peu la partie, sans exiger de grosses mises. Ce site me donne juste ce petit divertissement au bon moment.
Posted Dec 4 Kool