PHP4 and Oracle cont from -> [PHP-GENERAL] Changing the key of an array?

From: Date: Thu, 15 Jun 2000 00:28:29 +0000
Subject: PHP4 and Oracle cont from -> [PHP-GENERAL] Changing the key of an array?
Groups: php.general 
Request: Send a blank email to php-general+get-1892@lists.php.net to get a copy of this message
Thanks for the idea. But I can't get the PHP4 ORACLE connection via ODBC to work either. I have tried both drivers - Microsoft ODBC for Oracle - Oracle ODBC Driver Neither work :( The error for the Microsoft ODBC for Oracle driver is ------------------------------------------ Warning: SQL error: [Microsoft][ODBC driver for Oracle][Oracle]Error while trying to retrieve text for error ORA-12154, SQL state 08001 in SQLConnect in include/db_odbc.inc on line 30 Database error: Link-ID == false, odbc_pconnect failed ODBC Error: 0 () Session halted. ----------------------------------------- Oracle ODBC Driver gives the following error ---------------------------------------- Warning: SQL error: [Oracle][ODBC][Ora]Error while trying to retrieve text for error ORA-12154 , SQL state 08004 in SQLConnect in include/db_odbc.inc on line 30 Database error: Link-ID == false, odbc_pconnect failed ODBC Error: 0 () Session halted. ---------------------------------------- > If you're desperate, make ODBC calls from PHP4 and set up an ODBC > datasource that points at your Oracle DB. *shrug* > > -Szii > > At 09:45 AM 6/15/00 +1000, you wrote: > > > >I am still using PHP3.0.16 at the moment because I can't get the oracle > functions working for the Win32 version of PHP4.0 :( > > > >Looks like I am going to have to be patient till someone compiles a > working version of PHP4 + Oracle. > > > >> At 09:24 AM 6/15/00 +1000, c.just@phoenixdigital.com wrote: > >> > >> >Close, veeeery close, but not quite there :( > >> > > >> >The thing I should have mentioned was that I was trying to reset a value > >> >which got entered into the associative array like this. > >> >$filetypes[""] =34; > >> >It has a blank key. > >> > > >> >I did not set it like above it was set within a loop. > >> >------------------- > >> > # FIND AND RECORD FILE EXTENSION FOR FILE REQUESTS ONLY > >> > if(eregi("([^\./]*)$",$url,$regs)){ > >> > $filetypes[$ext]++; > >> > } > >> >------------------- > >> > > >> >I am trying to delete the value for the blank key. > >> >When I do this. > >> >unset($filetypes[""]); > >> >It clears the entire array which is not the desired effect. > >> > >> Hello All, > >> > >> What version of PHP are you using? > >> I tried the following code snippet in PHP 4.0.0 on NT and PHP 3.0.12 on > BSDi: > >> > >> <pre> > >> <? > >> $filetypes[""] =34; > >> $filetypes["a"] =12; > >> $filetypes["b"] =23; > >> > >> var_dump ($filetypes); > >> unset ($filetypes[""]); > >> var_dump ($filetypes); > >> > >> ?> > >> > >> and got the following output for (formatted for your viewing pleasure :): > >> > >> array(3) { > >> [""] => int(34) > >> ["a"]=> int(12) > >> ["b"]=> int(23) > >> } > >> > >> array(2) { > >> ["a"]=> int(12) > >> ["b"]=>int(23) > >> } > >> > >> In any case, a better solution would be to skip over or re-assign the empty > >> values. > >> > >> HTH, > >> > >> > >> Zak Greant > >> Creative Director > >> Nucleus Information Service Inc. > >> > >> "I am rather like a mosquito in a nudist camp: I know what I ought to do, > >> but I don't know where to begin." > >> - Stephen Bayne

« previous php.general (#1892) next »