Re: RE: More on Oracle strings
| From: | Rob Curts | Date: | Thu, 20 Jul 2000 15:36:10 +0000 |
| Subject: | Re: RE: More on Oracle strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7436@lists.php.net to get a copy of this message | ||
You're definitly right about binding variables in oracle. It can prove for
EXTREMEMLY fast sql queries (especially if you have big SQL statements with
alot of joins). Here's an example:
<?
$my_bind = "VARIABLE"; /* hopefully you can get this value from a POST */
PutEnv("ORACLE_HOME=/path/to/ORACLE");
PutEnv("ORACLE_SID=YOUR_ORACLE_SID");
$dbh = ocilogon("username","password","SID");
$sql = "SELECT SOMETHING FROM TABLE WHERE SOME_ID = :some_id ";
$sth = ociparse($dbh,$sql);
ocibindbyname($sth,":some_id",&$my_bind,6);
ociexecute($sth,OCI_DEFAULT);
while (ocifetch($sth)) {
$my_output = ociresult($sth,1);
}
?>
on 7/20/00 11:34 AM, Florian Clever at fc@clever-software-solutions.de
wrote:
> Hi,
>
> when using Oracle it is always good to bind variables.
> The advantages are speed improvement and you do not have to worry about the
> ' to '' conversion.
>
>
> Florian Clever
>
> USA 503 977-0480 (Office)
> USA 503 246-2803 (home)
>
> http://www.Clever-Software-Solutions.de
>
> -----Original Message-----
> From: Richard Yaker [mailto:ryaker@withoutabox.com]
> Sent: Tuesday, July 18, 2000 4:51 PM
> To: php-general@lists.php.net
> Subject: More on Oracle strings
>
>
> These are my settings in php.ini
>
>
> magic_quotes_gpc = On ; magic quotes for incoming
> GET/POST/Cookie data
> magic_quotes_runtime= On ; magic quotes for runtime-generated data,
> e.g. data from SQL, from exec(), etc.
> magic_quotes_sybase = On ; Use Sybase-style magic
> quotes (escape ' with '' instead of \')
>
> I am running php as a static module for apache, any idea why I am still
> getting
>
> update BLANKset
>
> festival_name='blank\'s',festival_nickname='music',festival_description='',a
> ddress1='8888
>
> street',address2='',address3='',city='LA',state='CA',zipcode='90064',country
>
> _code='241',telephone='333.333.3434',fax='333.333.3434',url='http://www.with
> outabox.com',email='info@with.com',mission_statement='To suceed and go
> where
> no one has gone before',objective='To rock the
>
> house',anniversary='16',market='Y',academy_nominating='Y',WAB_award='N',WAB_
>
> sponsor_interest='',general_rules='',online_payment='Y',create_date='11-JUL-
> 00' where festival_id='1001'
>
>
> instead of
>
> update BLANKset
>
> festival_name='blank''s',festival_nickname='music',festival_description='',a
> ddress1='8888
>
> street',address2='',address3='',city='LA',state='CA',zipcode='90064',country
>
> _code='241',telephone='333.333.3434',fax='333.333.3434',url='http://www.withõg�Aˆ6º0;Å÷
> øî
> outabox.com',email='info@with.com',mission_statement='To suceed and go
> where
> no one has gone before',objective='To rock the
>
> house',anniversary='16',market='Y',academy_nominating='Y',WAB_award='N',WAB_
>
> sponsor_interest='',general_rules='',online_payment='Y',create_date='11-JUL-
> 00' where festival_id='1001'
>