FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=18374&edit=1

ID: 18374
Updated by: danielc@analysisandsolutions.com
Reported By: matt@mattgarrett.org
Summary: Autoexecute & Autoprepare doesn't work with mysqli
-Status: Open
+Status: Bogus
Type: Bug
Package: MDB2_Driver_mysqli
Operating System: Mac/MAMP
PHP Version: 5.3.1
Roadmap Versions:
New Comment:

-Status: Open
+Status: Bogus
The example is just a suggestion, not complete code. I'm guessing you
don't have a table named "user." Change $affectedRows->getMessage() to
$affectedRows->getUserInfo() to get the full details of the error.


Previous Comments:
------------------------------------------------------------------------

[2011-03-21 10:13:52] alec

-Package: MDB2
+Package: MDB2_Driver_mysqli


------------------------------------------------------------------------

[2011-03-18 17:14:24] ldsnerd

Description:
------------
I get an error every time I try and run autoexec or autoprepare against
mysqli in php 5.3.5. It gives me "an unknown error occured" in mdb2.
When I switch it to mysql, the script works flawlessly. This is based
off the sample scripts on your website...the sample scripts do not work.

Test script:
---------------
<?php
// Once you have a valid MDB2 object named $mdb2...
$table_name = 'user';

$fields_values = array(
'name' => 'Fabien',
'country' => 'France'
);
$types = array('text', 'text');

$mdb2->loadModule('Extended');
$affectedRows = $mdb2->extended->autoExecute($table_name,
$fields_values,
MDB2_AUTOQUERY_UPDATE, 'id = '.$mdb2->quote(1,
'integer'), $types);

if (PEAR::isError($affectedRows)) {
die($affectedRows->getMessage());
}
?>

Expected result:
----------------
Successfull insert

Actual result:
--------------
MDB2 Error: unknown error - _execute: [Error message: Unable to execute
statement][Native code: 0]

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedOct 25, '12 at 8:46p
activeOct 25, '12 at 8:46p
posts1
users1
websitepear.php.net

1 user in discussion

Danielc: 1 post

People

Translate

site design / logo © 2022 Grokbase