note 7792 added to ODBC functions

From: Date: Tue, 15 Aug 2000 18:52:17 +0000
Subject: note 7792 added to ODBC functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-1910@lists.php.net to get a copy of this message
For those having trouble with apostrophies in their ODBC queries: If the database you are connecting to supports CHAR(39), which prints the character associated with this ASCII number, or something like it, try this: $myInput = ereg_replace("'","'+CHAR(39)+'",$myInput); $query = "Select * From Table Where (Field='$myInput')"; $connection = odbc_connect("mydb","myuserid","mypass"); $result = odbc($connection,$query); p.s. Don't forget the 's around the variable in the query line... good luck http://www.php.net/manual/ref.odbc.php

« previous php.notes (#1910) next »