[PHP-DB] Re: php and db/c
[EMAIL PROTECTED] wrote: Hello everyone, We are running an old database system called db/c and attempting to access the information via php. We have managed to make an odbc connection to the databases, and can successfully retrieve the field names, and field counts. However, php insists the tables are empty, returning -1 (empty set) for the odbc_num_rows(). When we make a raw odbc connection to run a direct sql query on the data, it all shows up fine. There is some miscommunication between odbc and php that is eluding us. Any input or suggestions would be welcomed. Thank you, Jay Merritt [EMAIL PROTECTED] Many odbc drivers do not return the correct value for odbc_num_rows. Have you tried odbc_result_all to see what comes back? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Database Connection
You need to specify some env variables before you connect: heres what I do. # putenv(LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib); putenv(DB2INSTANCE=db2inst1); # HTH Mark -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 9:43 AM To: Jerry; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Database Connection Jerry, I believe it's the sqllib dir, but you can try the other or experiment with just /home/db2inst1/sqllib If created by the DB2 client installer, try applying the environment variables script: . /home/db2inst1/sqllib/db2profile Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Jerry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Database Connection Thanks Andrew for your answer. In the environment variables I have already: DB2INSTANCE=db2inst1 LD_LIBRARY_PATH=:/home/db2inst1/sqllib/lib Is it correct ? Or does it need to point to the DB2 Client directory /usr/IBMdb2/V7.1/lib Thanks. Jerry Andrew Hill [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Jerry, Installing DB2 Client will allow you to use the ODBC functions in PHP, but be aware that you are not actually using any ODBC Drivers in this instance. PHP allows hiding of certain database specific functions under a Unified ODBC that uses the ODBC functions without using true ODBC database communication. That being said, you don't need to link --with-iODBC unless you are using ODBC Drivers, so it's not an issue here. If Apache doesn't start, I'd check it's logs, but you might be encountering a situation where the DB2 libraries were in the path at compile time and are not at Apache start time. Try setting LD_LIBRARY_PATH environment variable to include the location of your DB2 Client. Andrew Hill . -- 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Performance problems in NC
This could be due to missing tags such as /body and /html -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: Monday, October 29, 2001 6:41 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Performance problems in NC Hi there, I have problems with the performance while using NC. It workes fine with IE. As soon as I access the db. It takes aproximatelly 1 -2 min till I see the page. Does anybody know some help? Thank you Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] DB2 Performance issue - More Info
From the IBM CLI Reference: SQL_ATTR_ODBC_CURSORS (DB2 CLI v5) This connection attribute is defined by ODBC, but is not supported by DB2 CLI. Any attempt to set or get this attribute will result in an SQLSTATE of HYC00 (Driver not capable). A 32-bit option specifying how the Driver Manager uses the ODBC cursor library. So I guess this means the message below was related to using a 3rd party odbc driver. Shucks.. Regards Mark -Original Message- From: Mark Newnham [mailto:[EMAIL PROTECTED]] Sent: Monday, October 01, 2001 3:33 PM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] DB2 Performance issue This was posted on the newsgroup a couple of months ago: Christian Szardenings wrote: Hi Andrew, thanks a lot for your help. Today we discovered what our real problem was: After playing a little bit with the php-scripts that try to connect to the IBM DB2, we set the optional parameter Cursortype when calling odbc_pconnect(). And the exciting thing: When we set the cursor type to SQL_CUR_USE_ODBC Cursor Type, then the whole query speed up from 1 till 10 seconds to 0.2 till 0.3 seconds for 100 records. Amazing!!! Therfore, PHP is just almost fast as calling the DB2 from Servlets using JDBC (don't take too much care about the speed at whole: the database was on a completely other location, so the whole connection was made over a slow network connection). I hope this helps when other encounter the same problem when trying to connect to DB2 from PHP. Kind regards, Christian Szardenings This posting has caused some discussion amongst some of us who are trying to use DB2 in Native mode (i.e. using Unified ODBC) as the IBM driver manager appears not to support this parameter. ( An odbc connect with the specified parameter returns [IBM][CLI Driver] CLI0150E Driver not capable. SQLSTATE=S1C00 Could the author or anyone else who knows, please clarify this posting if they are using unified odbc or perhaps a third party ODBC driver. TIA Mark -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Windows DLL extension for DB2 needed
Does anyone have a dll extension to enable access to DB2 from PHP 4? I don't have access to a Windows compiler. TIA Mark -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Re: PHP vs. 2 database softwares
When i was switching back and forth between those 2 environments, I had to remove the config.cache file before doing a 'configure' in order to make it compile correctly. -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Monday, October 01, 2001 1:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: PHP vs. 2 database softwares Well, I did that. I typed in ./configure --with-iodbc=/usr/local/odbcsdk --with-ibm-db2=/usr/lp/db2_06_0 1 and it can compile without a problem. However, I checked the result of the configure and it didn't display the iodbc for some reason. So, that's why the iodbc was not compiled with PHP. I did have hte environment variable specified correctly. I tried to test it to see if it work if I do the configure command without hte ibm db2 option and it can see the iodbc. So, when I put the iodbc option back in, it can not see the iodbc. Why is that? I do not know? I'm using PHP-4.0.6 Scott John Lim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have connected simultaneously to interbase, mysql, postgresql, oracle, mssql, microsoft access, foxpro in one script. You just configure PHP to be compiled with multiple database options. Simple. - John Scott Fletcher [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! I found that PHP can be compiled and work with only one database software. You won't be able to have PHP to work with 2 seperate database softwares. (You can compile it but it will work only with one databse software, not both, no matter what). I checked the php ./configure file and found that it is not design to include 2 seperate databases when you want it to. Man, it would be very nice to have PHP to work with multiple database softwares. The only way you can have PHP to work with more than 1 database softwares, then you would need to compile PHP Apache to work with one database. Then re-configure and re-compile PHP Apache to a seperate directory. That way, you will have 2 apaches and run them together. There is no other way! Thanks, Scott -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] DB2 Performance issue
This was posted on the newsgroup a couple of months ago: Christian Szardenings wrote: Hi Andrew, thanks a lot for your help. Today we discovered what our real problem was: After playing a little bit with the php-scripts that try to connect to the IBM DB2, we set the optional parameter Cursortype when calling odbc_pconnect(). And the exciting thing: When we set the cursor type to SQL_CUR_USE_ODBC Cursor Type, then the whole query speed up from 1 till 10 seconds to 0.2 till 0.3 seconds for 100 records. Amazing!!! Therfore, PHP is just almost fast as calling the DB2 from Servlets using JDBC (don't take too much care about the speed at whole: the database was on a completely other location, so the whole connection was made over a slow network connection). I hope this helps when other encounter the same problem when trying to connect to DB2 from PHP. Kind regards, Christian Szardenings This posting has caused some discussion amongst some of us who are trying to use DB2 in Native mode (i.e. using Unified ODBC) as the IBM driver manager appears not to support this parameter. ( An odbc connect with the specified parameter returns [IBM][CLI Driver] CLI0150E Driver not capable. SQLSTATE=S1C00 Could the author or anyone else who knows, please clarify this posting if they are using unified odbc or perhaps a third party ODBC driver. TIA Mark -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Storing code in a mysql database
I'm trying to store SQL code in a blob field in a mysql database, but i'm having a problem. The code looks like this $sql='select * from vehicle where company=$company_code';; After I retrieve it from the db i eval() it to get the result. I can make this work if i store the code in a variable, but not if i store it in a database table and retrieve it. I am sure i am missing the right combination of addslashes/striplashes etc. can anyone help on this problem? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Storing code in a mysql database
I've now progressed to the point where I'm not getting eval errors. The next problem is that is doesn't substitute the variable names: so the code $company_code=1; eval($sql='select * from vehicle where company=$company_code';); ends up $sql equal to 'select * from vehicle where company=$company_code' and not 'select * from vehicle where company=1' Any clues? TIA Mark -Original Message- From: Mark Newnham [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 19, 2001 2:54 PM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Storing code in a mysql database I'm trying to store SQL code in a blob field in a mysql database, but i'm having a problem. The code looks like this $sql='select * from vehicle where company=$company_code';; After I retrieve it from the db i eval() it to get the result. I can make this work if i store the code in a variable, but not if i store it in a database table and retrieve it. I am sure i am missing the right combination of addslashes/striplashes etc. can anyone help on this problem? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] PHP x Progress
Yes, ODBC - If you are using unix, i recommend the openlink MT drivers (www.openlinksw.com) There is no native mode interface available for PROGRESS. -Original Message- From: André [mailto:[EMAIL PROTECTED]] Sent: Monday, July 23, 2001 11:42 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP x Progress How I can access a Progress database? ODBC? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] using ADODB db class
Not sure if this is really the right list to ask on, so please excuse me. I am trying to use the adodb db class with php4/mysql. On problem i have hit is that if i retrieve 2 tables with a join and the 2 tables both have a field of the same name, the command $result-fields(fieldname) always returns the value of the second field of that name. i could loop through the fields via index, then use fetchfield() to retrieve the name, but generically, I would also like to retrieve the table that the field is attached to. Does anyone know of a way to do this or a command that has this option? Thanks Mark -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] odbc_tableprivileges help required
Could someone supply simple examples of how this command works. I am trying to use it like this - $conn=odbc_connect(poinv,,); $result=odbc_tableprivileges($conn,pt_mstr,%,%); odbc_result_all($result); but this returns Warning: SQL error: , SQL state 0 in SQLTablePrivileges in /opt/apache/lib/htdocs/poinv/test.php on line 9 Warning: Supplied argument is not a valid ODBC result resource in /opt/apache/lib/htdocs/poinv/test.php on line 11 So my understanding of this is obviously incorrect Thanks Mark # Mark Newnham Application Design Associates, Inc 6021 S.Syracuse Way #302 Englewood, CO 80111, USA http://www.adacorp.com # -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] File Optimisation
The first thing I would look at ( having had the same issue ) is whats actually in the document. I managed to reduce the size of data delivered by 60% by 2 methods. 1. Ruthless use of css in table formatting. 2. Creating javascript functions for even the smallest inline feature such as mouseovers. Regards Mark -Original Message- From: Steve Brett [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 14, 2001 4:02 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] File Optimisation I have a calendar system that details the appointments for various departments in the company and am having problems with the sheers size of the html docs that are returned. One department insists that they nned to see all the users in one go (approx 110) and the calendars for 3 months. This causes an html doc being returned frm the server that is 3.5 meg. Whilst is takes the server 4 seconds to build and deliver this I was wondering if there is any way to speed things up and reduce the amount of network traffic. Would zipping the file b4 it is sent be a good (and easy) way to go ? Thanks in advance, Steve Brett Internal Development EMIS Ltd. "Privileged and /or Confidential information may be contained in this message. If you are not the original addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, please delete this message, and notify us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independently of this message." -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Problem with odbc_field_type?
Is there a problem with odbc_field_type? I always receive a null back. I dont have a problem with odbc_field_len. Is it perhaps that some db types don't respond correctly. Thanks Mark -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] SELECT problem (2)
You probably want this.options[this.selectedIndex].value -Original Message- From: Julio Cuz, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 2:36 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SELECT problem (2) Hi-- Sorry, I forgot to finish the previous e-mail: What's wrong with this line? echo("SELECT onChange=\"window.location=\"$PHP_SELF?campus+=\"this.value\"\"\" NAME='campus'"); I'm trying to RELOAD the current page with the new value of "$campus" after the user selects a campus from a drop-down menu. But I can't get the "this.value" line to pass the value of "$campus" to the new loaded page. Help! Julio Cuz, Jr. Riverside Community College [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Redirect command?
if ( $x==true) { print "script language='javascript'\n"; print "window.open('b.php','_self');\n"; print "/script\n"; die; } -Original Message- From: Julio Cuz, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Redirect command? Hi-- I've been looking for a "redirect" command (basically redirect from page a to page b if something happens)... Julio Cuz, Jr. Riverside Community College [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] runing a query and a another task at the same time
I may be mistaken, but I believe that something as simple as calling a javascript window.open function effectively starts a parallel process, i.e. it is a non-blocking operation in a browser heres the sample code i used to test it. 1. A frameset with 2 frames, A and B. frame A has src=test1.php 2. test1.php script language='JavaScript' window.open('test2.php','B'); /script ?php for ($i=0;$i10;$i++) { print $i . "br"; } ? 2. test2.php ?php for ($i=0;$i10;$i++) { print $i . "br"; } ? ~ The programs definitely run concurrently, and a quick view of my apache processes shows that 2 processes are being used by the program. HTH Mark -Original Message- From: Pedro M. S. Oliveira [mailto:[EMAIL PROTECTED]] Sent: Monday, February 19, 2001 6:02 PM To: PHP db Subject: [PHP-DB] runing a query and a another task at the same time hello all! i was wondering how to do a php script that works like this. i need to make an update to a database but at the same time i need to make a query to another database. the update and the query doesn't have anything to do with each other, they just need to run both in a paralel way. i was wondering how to do this with php in a NT box, i can also use a Linux box but the ultimate end i'll have to use NT (Grrr). this may seam confuse but the thing i wanna do is like paralel tasking, butting a function running on the background till its over and in the meanwhile another function that doesn't need the first function to end to start.. thank you all *** Pedro Miguel Silva Oliveira Cell Phone: +351 96 5867227 SMS: [EMAIL PROTECTED] Email: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Help with loop
$res = mysql_query("SELECT * FROM ecomm where ID ='$sid'",$db)) if(!$res){echo("error preforming query: " . mysql_error());exit();} //error trap while( $row=mysql_fetch_array($res)){ $pno=$row["part"]; ##### Mark Newnham Application Design Associates, Inc 6021 S.Syracuse Way #302 Englewood, CO 80111, USA http://www.adacorp.com # -Original Message- From: Robert [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 12:31 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Help with loop Why does this spit out the same part over and over until it times out? I have 2 tables in the same database 1: bruindba ---Parts database specific_p Part Number manufactur ---Manufacturer package ---Package in 2: ecomm ---Ecommerce database ID ---session ID random number generated when first part is entered part ---Part number What I am trying to do is store the part numbers with the session ID in ecomm and then pull all of them out with descriptions from bruindba. //- Get parts for this session // Check ecomm DB for parts by session ID --- while ($res = mysql_query("SELECT * FROM ecomm where ID ='$sid'",$db)){ if(!$res){echo("error preforming query: " . mysql_error());exit();} //error trap $row=mysql_fetch_array($res); $pno=$row["part"]; //-Get part info from bruindba --- $result = mysql_query("SELECT * FROM bruindba where specific_p ='$pno'",$db); if(!$result){echo("error preforming query: " . mysql_error());exit();} //error trap $row=mysql_fetch_array($result); $spp=$row["specific_p"]; $mfc=$row["manufactur"]; $pkg=$row["package"]; echo" $spp"; echo" $pkg"; echo" $mfc"; } Thanks for any help you can provide -Bob- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] query error
Looks fine, now retrieve the rows from the query. -Original Message- From: Randy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 12:46 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] query error When I run any kind of query this is the value of result Resource id #2 Example $result= mysql_query (" Select * from ACCT_TBL ") or die ("Error".mysql_error()); print result; any ideas? randy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]