Re: Bug #3435: SQL Queries error

From: Date: Wed, 09 Feb 2000 10:44:06 +0000
Subject: Re: Bug #3435: SQL Queries error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-15326@lists.php.net to get a copy of this message
This is not an bug try: $str = "SELECT Field1 FROM Table WHERE Field 2 = 'o\''reilly enterprises'"; or $str = "SELECT Field1 FROM Table WHERE Field 2 = 'o''reilly enterprises'"; $str = addslashes($str); Greetz Wico ps you can close the bugreport self At 10:32 9-2-00 +0000, wj@isolaandisola.com wrote:
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? -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.dev (#15326) next »