mdb2

Connecting to MS SQL from PHP on IIS using PEAR MDB2

廉价感情. 提交于 2020-01-02 23:01:59
问题 Sorry to have to ask this here; php.net just seems to be full of exceptions and excuses regarding this. I'm running IIS 6.0 with PHP 5.3.6. I've got MDB2 installed and working (even with a custom-written driver for an off-brand RDBMS). That's all working great. But now I need to have PHP connect to a bit of standard technology: MS SQL. The problem is the mssql driver for MDB2 requires PHP to have been compiled with special flags. Hard to do with php binaries :). I could go down the road of

PHP List based on Form Selection: MDB2 Error: syntax error

谁都会走 提交于 2019-12-12 03:49:03
问题 I'm creating a table that outputs a list of country details based on a form selection but I keep getting this error: MDB2 Error: syntax error . How can I fix this type of error? Here is my code: <?php $db =& MDB2::connect($dsn); if(PEAR::isError($db)){ die($db->getMessage()); } $table_name="country"; $db->setFetchMode(MDB2_FETCHMODE_ASSOC); $country_id = mysql_real_escape_string($_GET["country_id"]); // collect values from a form sent with method=get $gdp = mysql_real_escape_string($_GET["gdp

Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll()

天大地大妈咪最大 提交于 2019-12-08 11:37:14
问题 I am upgrading a site from Fedora 14, PHP4, and PEAR DB to Fedora 16, PHP 5.4 and PEAR MDB2 2.5.0b3, and I am getting the error Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll(). in /usr/share/php/MDB2.php on line 1892 Obviously, I've checked line 1892 of the MDB2.php file, and it contains the error reporting code for the __call magic method (allows you to call a specific function by passing it into __call ) I have checked for usages of __call , and there don't seem to be

Preventing SQL injection in PHP with MDB2

狂风中的少年 提交于 2019-12-07 16:18:21
问题 I'm trying to figure out how to prevent sqlinjection, I wrote this basic function : function antiInjectie($inputfromform){ $temp = str_replace("'", "`",$inputfromform); $temp = str_replace("--", "~~",$temp); return htmlentitites($temp); } However someone told me to also take hex values in consideration, but how do I do this? Update I'm stuck with MDB2 and pgsql 回答1: Bobby-Tables has a good guide to preventing SQL injection. In short: Don't twiddle with the input yourself, use database API

Modifying a class to encapsulate instead of inherit

陌路散爱 提交于 2019-12-01 13:30:43
问题 The codebase I've been handed to work with features a databse class that inherits from MDB2. This forms the basis for the MVC framework in use (a custom built affair) and the models in turn inherit from db. As I'm sure some of you have noticed, this leads to a rather big problem. Every time you instantiate a model, the result is a new database connection being created. This is obviously quite wasteful. It also means that I'm unable to use transactions as intended, because if a transaction

Replacement for PEAR: MDB2 on PHP 5.3

心不动则不痛 提交于 2019-11-30 18:38:38
I've been using pear packages in php for years. I'm in the process of upgrading/moving a sites that uses the MDB2 pear package and it has not been updated for PHP 5.3.X. In 5.3, MDB2 is returning those new annoying errors. Unknown: Assigning the return value of new by reference is deprecated in /usr/local/lib/php/MDB2.php on line 390 I know I can change my error reporting settings to get rid of them, but I'd rather not make any exceptions. Anyway, Is anyone else using MDB2 these days and have a solution? Are there similar database packages you recommend? I would definitly go for an ORM, at

Replacement for PEAR: MDB2 on PHP 5.3

孤者浪人 提交于 2019-11-30 02:45:37
问题 I've been using pear packages in php for years. I'm in the process of upgrading/moving a sites that uses the MDB2 pear package and it has not been updated for PHP 5.3.X. In 5.3, MDB2 is returning those new annoying errors. Unknown: Assigning the return value of new by reference is deprecated in /usr/local/lib/php/MDB2.php on line 390 I know I can change my error reporting settings to get rid of them, but I'd rather not make any exceptions. Anyway, Is anyone else using MDB2 these days and have