php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3435 SQL Queries error
Submitted: 2000-02-09 11:32 UTC Modified: 2002-10-01 15:21 UTC
From: wj at isolaandisola dot com Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 3.0.13 OS: Slackware 7
Private report: No CVE-ID: None
 [2000-02-09 11:32 UTC] wj at isolaandisola dot com
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?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 15:21 UTC] hholzgra@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC