[PHP-DB] Multiple Update SQL Statements Execution
Hi, I am inquiring on this list to see if it is possible to create a script that takes multiple update statements without my having to write one "SQL" statement for each of the updates. I have a scenario of which I create a table of some sort with some existing information using Flex, and what I am told by my client is that no matter how many records there are on the screen, the users should be able to update any up to all the entries by simply pushing a button. I use Microsoft SQL, which I think that it does allow multiple update query execution. The problem is that I might have to come up with some method to accept all the "POST" variables the user provides into the script. Could anyone please give me some guidance on what kind of function I might use, or whether or not it is possible I can create a script that accepts as many "POST" variables as the users POST? Thanks a lot for your help. Alice _ Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today! http://get.live.com/toolbar/overview
Re: [PHP-DB] what sets the ORACLE_HOME variable and sets PHP/Apache environment
GREAT!!but how! http://us.php.net/manual/en/oci8.setup.php --- On Wed, 11/19/08, Christopher Jones <[EMAIL PROTECTED]> wrote: > From: Christopher Jones <[EMAIL PROTECTED]> > Subject: Re: [PHP-DB] what sets the ORACLE_HOME variable and sets PHP/Apache > environment > To: [EMAIL PROTECTED] > Cc: php-db@lists.php.net > Date: Wednesday, November 19, 2008, 5:27 AM > Fred Silsbee wrote: > > there is a file /etc/httpd/conf/httpd.conf > > > > I tried putting the ORACLE_HOME in this file but it > failed > > What failed and how? > > How was it set? > > [phpinfo output of] > >>> Compile-time ORACLE_HOME no value > > The lack of a value here is an artifact aka buglet of > installing from > the PECL package. I'll add it to the todo list of > issues to look at. > > Chris > > -- Email: [EMAIL PROTECTED] Tel: +1 650 506 > 8630 > Twitter: http://twitter.com/ghrdFree PHP Book: > http://tinyurl.com/f8jad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] what sets the ORACLE_HOME variable and sets PHP/Apache environment
here is where the error occurs:oci8.c /* use NLS_LANG if no or invalid charset specified */ if (!charsetid) { size_t rsize = 0; sword result; // here PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize)); if (result != OCI_SUCCESS) { charsetid_nls_lang = 0; } smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0); } doesn't anybody know how this stuff works! I connected to MySQL the very FIRST try! I didn't have to search their "C" code --- On Wed, 11/19/08, Christopher Jones <[EMAIL PROTECTED]> wrote: > From: Christopher Jones <[EMAIL PROTECTED]> > Subject: Re: [PHP-DB] what sets the ORACLE_HOME variable and sets PHP/Apache > environment > To: [EMAIL PROTECTED] > Cc: php-db@lists.php.net > Date: Wednesday, November 19, 2008, 5:27 AM > Fred Silsbee wrote: > > there is a file /etc/httpd/conf/httpd.conf > > > > I tried putting the ORACLE_HOME in this file but it > failed > > What failed and how? > > How was it set? > > [phpinfo output of] > >>> Compile-time ORACLE_HOME no value > > The lack of a value here is an artifact aka buglet of > installing from > the PECL package. I'll add it to the todo list of > issues to look at. > > Chris > > -- Email: [EMAIL PROTECTED] Tel: +1 650 506 > 8630 > Twitter: http://twitter.com/ghrdFree PHP Book: > http://tinyurl.com/f8jad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] what sets the ORACLE_HOME variable and sets PHP/Apache environment
Fred Silsbee wrote: > GREAT!!but how! How what? > http://us.php.net/manual/en/oci8.setup.php What about it? >> [phpinfo output of] > Compile-time ORACLE_HOME no value >> The lack of a value here is an artifact aka buglet of >> installing from >> the PECL package. I'll add it to the todo list of >> issues to look at. To make this very clear: This particular part of the phpinfo() output is a message string constructed at compile time and doesn't matter that it isn't showing a value at run time. As explained in other messages forums, look for ORACLE_HOME in the "Enviroment" section of phpinfo(). If that isn't set, find out how to set environment variables for the Apache on your OS. Chris -- Email: [EMAIL PROTECTED] Tel: +1 650 506 8630 Twitter: http://twitter.com/ghrdFree PHP Book: http://tinyurl.com/f8jad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Multiple Update SQL Statements Execution
On Wed, Nov 19, 2008 at 5:55 AM, Alice Wei <[EMAIL PROTECTED]> wrote: > I am inquiring on this list to see if it is possible to create a script that > takes multiple update statements without my having to write one "SQL" > statement for each of the updates. I'm not sure I understand your question. It is certainly possible to write one query that updates multiple rows at once. In other cases, you can use prepared statements and bound variables. If all you need to do is repeat a query of the same structure with different values, a prepared statement would be faster and mean cleaner code than sending repeated queries. Without more specific info from you, I don't think I can give a better answer than this. I've never worked with Microsoft SQL Server, so I doubt there's anything I can tell you about that in particular. > I have a scenario of which I create a table of some sort with some existing > information using Flex, and what I am told by my client is that no matter how > many records there are on the screen, the users should be able to update any > up to all the entries by simply pushing a button. I use Microsoft SQL, which > I think that it does allow multiple update query execution. The problem is > that I might have to come up with some method to accept all the "POST" > variables the user provides into the script. Let's see. If your POST includes the IDs of the rows you want to change and the value you want to update, it could go something like this. Note that I haven't tested it, so it might contain an error. I'm just trying to provide an illustration of the approach. quote($_POST['field']) . "' WHERE id IN (" . implode(',' $_POST['id']) . ")"; /* Send this query to your database as appropriate. It will set 'somecolumn' to the value of $_POST['field'] where the ID is in the list. In this case the form should submit the $_POST['id'] value as an array, which can be done by using setting the HTML name attribute to id[] (e.g. name="id[]"). */ ?> Does this help? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP MySQL Driver Choice -- Fastest?
Which is the fastest driver for this? ADODB PDO mysqli Anything else? -- Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest?
Micah Gersten wrote: Which is the fastest driver for this? ADODB PDO mysqli Either mysqli or pdo since they'd deal with the mysql client directly. ADODB is a php library, so it's not going to be as fast because you have php code overhead. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] what sets the ORACLE_HOME variable and sets PHP/Apache environment
there is no problem with my 11g1 system I also have a number of similar "impossible" unix/solaris/Linux installs under my belt! right now I am editing my /etc/httpd/conf/httpd.conf file from a php site: http://us.php.net/manual/en/oci8.setup.php ORACLE_HOME ORACLE_SID LD_PRELOAD??? LD_LIBRARY_PATH NLS_LANG ??? I have these: (still didn't work! SetEnv ORACLE_HOSTNAME localhost.localdomain SetEnv ORACLE_BASE /u01/app/oracle SetEnv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1 SetEnv ORACLE_SID lmkiiiGDNSID SetEnv ORACLE_TERM xterm SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib http://bugs.php.net/bug.php?id=31476 H! --- On Wed, 11/19/08, Jack van Zanen <[EMAIL PROTECTED]> wrote: > From: Jack van Zanen <[EMAIL PROTECTED]> > Subject: Re: [PHP-DB] what sets the ORACLE_HOME variable and sets PHP/Apache > environment > To: [EMAIL PROTECTED] > Cc: "Christopher Jones" <[EMAIL PROTECTED]> > Date: Wednesday, November 19, 2008, 9:04 PM > Well, > > > It is very dificult to troubleshoot these things without > actually sitting > behind the console. We may make assumptions that may not > neccessarily be > true. > > I am an Oracle DBA and I have installed Oracle on UNIX more > times than I > care to remember so I can assume that my Oracle Setups are > correct, yours I > do not know. I have on occassions in the past used oracle > as a backend > database for php apps and it was as simple as MySQL. Succes > on first > attempt. > I now use Oracle, Php and Apache on windows and have been > using this for > several years now and this is a bit more straightforward. > > > Jack > > 2008/11/20 Fred Silsbee <[EMAIL PROTECTED]> > > > here is where the error occurs:oci8.c > >/* use NLS_LANG if no or invalid charset > specified */ > >if (!charsetid) { > >size_t rsize = 0; > >sword result; > > // here > >PHP_OCI_CALL_RETURN(result, > OCINlsEnvironmentVariableGet, > > (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, > &rsize)); > >if (result != OCI_SUCCESS) { > >charsetid_nls_lang = 0; > >} > > > smart_str_append_unsigned_ex(&hashed_details, > > charsetid_nls_lang, 0); > >} > > > > doesn't anybody know how this stuff works! > > > > I connected to MySQL the very FIRST try! I didn't > have to search their "C" > > code > > > > > > > > > > > > --- On Wed, 11/19/08, Christopher Jones > <[EMAIL PROTECTED]> > > wrote: > > > > > From: Christopher Jones > <[EMAIL PROTECTED]> > > > Subject: Re: [PHP-DB] what sets the ORACLE_HOME > variable and sets > > PHP/Apache environment > > > To: [EMAIL PROTECTED] > > > Cc: php-db@lists.php.net > > > Date: Wednesday, November 19, 2008, 5:27 AM > > > Fred Silsbee wrote: > > > > there is a file /etc/httpd/conf/httpd.conf > > > > > > > > I tried putting the ORACLE_HOME in this file > but it > > > failed > > > > > > What failed and how? > > > > > > How was it set? > > > > > > [phpinfo output of] > > > >>> Compile-time ORACLE_HOME no value > > > > > > The lack of a value here is an artifact aka > buglet of > > > installing from > > > the PECL package. I'll add it to the todo > list of > > > issues to look at. > > > > > > Chris > > > > > > -- Email: [EMAIL PROTECTED] Tel: +1 > 650 506 > > > 8630 > > > Twitter: http://twitter.com/ghrdFree PHP > Book: > > > http://tinyurl.com/f8jad > > > > > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > J.A. van Zanen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] close clue?
http://bugs.php.net/bug.php?id=43186 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest?
How does the "default" php_mysql.dll compare to these? Is mysqli faster than mysql? tia, Yves -- Original Message -- Received: Wed, 19 Nov 2008 04:00:46 PM CST From: Chris <[EMAIL PROTECTED]> To: Micah Gersten <[EMAIL PROTECTED]>Cc: PHP DB Subject: Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest? Micah Gersten wrote: > Which is the fastest driver for this? > ADODB > PDO > mysqli Either mysqli or pdo since they'd deal with the mysql client directly. ADODB is a php library, so it's not going to be as fast because you have php code overhead. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest?
Chris wrote: > Micah Gersten wrote: >> Which is the fastest driver for this? >> ADODB >> PDO >> mysqli > > Either mysqli or pdo since they'd deal with the mysql client directly. > > ADODB is a php library, so it's not going to be as fast because you > have php code overhead. > ADODB is precompiled for PHP5. Do you know of any tests? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] oci8
oci8 OCI8 Supportenabled Version 1.3.4 Revision$Revision: 1.269.2.16.2.38.2.20 $ Active Persistent Connections 0 Active Connections 0 Compile-time ORACLE_HOMEno value Libraries Used no value Temporary Lob support enabled Collections support enabled Directive Local Value Master Value oci8.connection_class no valueno value oci8.default_prefetch 100 100 oci8.events Off Off oci8.max_persistent -1 -1 oci8.old_oci_close_semanticsOff Off oci8.persistent_timeout -1 -1 oci8.ping_interval 60 60 oci8.privileged_connect Off Off oci8.statement_cache_size 20 20 even with: Global: in /etc/httpd/conf/httpd.conf SetEnv ORACLE_HOSTNAME localhost.localdomain SetEnv TNS_ADMIN /u01/app/oracle/product/11.1.0/db_1/network/admin SetEnv ORACLE_BASE /u01/app/oracle SetEnv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1 SetEnv ORACLE_SID lmkiiiGDNSID SetEnv ORACLE_TERM xterm SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest?
Micah Gersten wrote: Chris wrote: Micah Gersten wrote: Which is the fastest driver for this? ADODB PDO mysqli Either mysqli or pdo since they'd deal with the mysql client directly. ADODB is a php library, so it's not going to be as fast because you have php code overhead. ADODB is precompiled for PHP5. Do you know of any tests? It's a dll or .so file? -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest?
YVES SUCAET wrote: How does the "default" php_mysql.dll compare to these? Is mysqli faster than mysql? I'd call that a native driver. No idea about mysqli vs mysql. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] close clue?
Fred Silsbee wrote: http://bugs.php.net/bug.php?id=43186 Why do you think it's a clue? Are you getting a crash? Does your PHP command line work? So far we have almost zero information about your configuration in particular we don't have phpinfo() output (despite suggestions you check it). Chris -- Email: [EMAIL PROTECTED] Tel: +1 650 506 8630 Twitter: http://twitter.com/ghrdFree PHP Book: http://tinyurl.com/f8jad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest?
Chris wrote: > Micah Gersten wrote: >> Chris wrote: >>> Micah Gersten wrote: Which is the fastest driver for this? ADODB PDO mysqli >>> Either mysqli or pdo since they'd deal with the mysql client directly. >>> >>> ADODB is a php library, so it's not going to be as fast because you >>> have php code overhead. >>> >> >> ADODB is precompiled for PHP5. Do you know of any tests? > > It's a dll or .so file? > On Linux, it's an .so file, yes: http://packages.debian.org/lenny/i386/php5-adodb/filelist Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP MySQL Driver Choice -- Fastest?
Micah Gersten wrote: Chris wrote: Micah Gersten wrote: Chris wrote: Micah Gersten wrote: Which is the fastest driver for this? ADODB PDO mysqli Either mysqli or pdo since they'd deal with the mysql client directly. ADODB is a php library, so it's not going to be as fast because you have php code overhead. ADODB is precompiled for PHP5. Do you know of any tests? It's a dll or .so file? On Linux, it's an .so file, yes: http://packages.debian.org/lenny/i386/php5-adodb/filelist Didn't know that :) Cool. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] oci_connect
I have the following in /etc/httpd/conf/httpd.conf SetEnv ORACLE_HOSTNAME localhost.localdomain SetEnv TNS_ADMIN /u01/app/oracle/product/11.1.0/db_1/network/admin SetEnv ORACLE_BASE /u01/app/oracle SetEnv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1 SetEnv ORACLE_SID lmkiiiGDNSID SetEnv ORACLE_TERM xterm SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib but showing in phpinfo is: oci8 OCI8 Supportenabled Version 1.3.4 Revision$Revision: 1.269.2.16.2.38.2.20 $ Active Persistent Connections 0 Active Connections 0 Compile-time ORACLE_HOMEno value ?? Libraries Used no value Temporary Lob support enabled Collections support enabled Directive Local Value Master Value oci8.connection_class no valueno value oci8.default_prefetch 100 100 oci8.events Off Off oci8.max_persistent -1 -1 oci8.old_oci_close_semanticsOff Off oci8.persistent_timeout -1 -1 oci8.ping_interval 60 60 oci8.privileged_connect Off Off oci8.statement_cache_size 20 20 NOTHING about Oracle in php.ini but there is a section about MySQL -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] oci_connect
Fred Silsbee wrote: > I have the following in /etc/httpd/conf/httpd.conf > > SetEnv ORACLE_HOSTNAME localhost.localdomain > SetEnv TNS_ADMIN /u01/app/oracle/product/11.1.0/db_1/network/admin > SetEnv ORACLE_BASE /u01/app/oracle > SetEnv ORACLE_HOME /u01/app/oracle/product/11.1.0/db_1 > SetEnv ORACLE_SID lmkiiiGDNSID > SetEnv ORACLE_TERM xterm > SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib I personally don't set them in httpd.conf because I don't believe putting them there works consistently across platforms. And we can't cross check your site because you haven't yet mailed the information I requested in more than one email/post. And I really doubt LD_LIBRARY_PATH being set before Apache executable starts is a good idea. I strongly suggest you set the environment in the shell that starts Apache: export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 export ORACLE_SID=lmkiiiGDNSID export LD_LIBRARY_PATH /u01/app/oracle/product/11.1.0/db_1/lib:/lib:/usr/lib /usr/sbin/apachectl start (The other variables aren't needed) You may need to make sure these are set at boot time, if you Apache starts at machine boot. > but showing in phpinfo is: > > > oci8 > OCI8 Support enabled > Version1.3.4 > Revision $Revision: 1.269.2.16.2.38.2.20 $ > Active Persistent Connections 0 > Active Connections 0 > Compile-time ORACLE_HOME no value ?? > Libraries Used no value > Temporary Lob support enabled > Collections supportenabled > > Directive Local Value Master Value > oci8.connection_class no valueno value > oci8.default_prefetch 100 100 > oci8.eventsOff Off > oci8.max_persistent-1 -1 > oci8.old_oci_close_semantics Off Off > oci8.persistent_timeout-1 -1 > oci8.ping_interval 60 60 > oci8.privileged_connectOff Off > oci8.statement_cache_size 20 20 These values are not relevant to your problem. What is in the section with the heading "Environment"? Check for the ORACLE_HOME and ORACLE_SID variables there. On RHEL 5.2, if I use SetEnv in httpd.conf, I only see the variables in the "Apache Environment" section and not the "Environment" section of phpinfo(). > NOTHING about Oracle in php.ini but there is a section about MySQL That's fine. Nothing needs to be set. Everything has a default. You can see the defaults in phpinfo output, and they are mostly tuning settings. You can add any configuration setting you want to change. Nothing there will affect a basic connection test script like the one you previously posted. Chris -- Email: [EMAIL PROTECTED] Tel: +1 650 506 8630 Twitter: http://twitter.com/ghrdFree PHP Book: http://tinyurl.com/f8jad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] oci_connect
On Wed, Nov 19, 2008 at 8:15 PM, Fred Silsbee <[EMAIL PROTECTED]> wrote: [snip!] "Fred," Please keep all of your posts in the same thread with the same subject. You're making it very difficult for others to follow along with your ramblings, and seem to even be confusing yourself a bit. Chris has been trying to get the information he needs from you, but it looks like you're running over yourself. It happens with frustration, I completely understand. ;-P Keep everything in one thread so that it's easy to follow and so that Chris and others can help you out. Once you get the information sorted out in one linear fashion, I think you'll find the problems aren't as serious as you might have thought. And if they are, then we can all help you to solve them. -- http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] Ask me about our current hosting/dedicated server deals! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php