Bug #3435: SQL Queries error
| From: | wj at isolaandisola dot com | Date: | Wed, 09 Feb 2000 10:32:01 +0000 |
| Subject: | Bug #3435: SQL Queries error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15325@lists.php.net to get a copy of this message | ||
From: wj@isolaandisola.com
Operating system: Slackware 7
PHP version: 3.0.13
PHP Bug Type: ODBC related
Bug description: SQL Queries error
I cannot execute queries that have a ' in them ie:
$str = "SELECT Field1 FROM Table WHERE Field 2 = 'o''reilly
enterprises'";
$odbc_res = odbc_exec($odbc_conn,$str);
This works on all other queries apart from ones with the quote
I am using openlink glibc2.2.1
and iodbc latest sdk
complied as such
cd /usr/src/libiodbc-2.50.3
./configure
make
make install
then run
sh install in /usr/local/openlink
when I run their odbctest app I can connect to the Database and Run the problem query with no
errors, so I guess the openlink stuff is fine
Then install apache and php as:
cd /usr/src
cd apache_1.3.11
make clean
make distclean
./configure --prefix=/usr/local/apache
cd ../php-3.0.13
make clean
make distclean
./configure --with-apache=../apache_1.3.11 --with-iodbc=/usr/local
--with-openlink=/usr/local/openlink --en
able-track-vars --enable-force-cgi-redirect --with-config-file-path=/usr/local/apache/conf
make
make install
cd ../apache_1.3.11
./configure --prefix=/usr/local/apache --activate-module=src/modules/php3/libphp3.a
make
make install
the reboot and I can run simple queries but the single quotes are killing me:
Why does this work via odbctest and not via php?
the magic quotes are:
all on at the moment
any ideas?