Re: [PHP-DB] upgrade to 4.2, now odbc cursor problem
Hi Ryan, I am using the binary dist. isapi on w2k server with IIS 5 (*not my choice) The reason I am eager to upgrade to 4.2.0 is that there is supposed to be a bug fix in the ODBC handling of long-varchar's (which is very irritating because it crashed the entire IIS). Kind regards, Joop Marijne ps. today I will try to create a simple test case to reproduce the bug. - Original Message - From: Ryan Jameson (USA) [EMAIL PROTECTED] To: Joop Marijne [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, April 29, 2002 8:17 AM Subject: RE: [PHP-DB] upgrade to 4.2, now odbc cursor problem Hi Joop, The ODBC guys know about this and several other issues with 4.2. Did you download the binary distribution or did you compile your own? One possibility concerning my issue is the options that were compiled into the binary distribution. It might be best to stay at 4.1.2 for now. I'm having ODBC problems that are keeping me at an older version right now too. Ryan -Original Message- From: Joop Marijne [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 6:39 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] upgrade to 4.2, now odbc cursor problem Hi All, I am working with PHP for quite some time now. For this customer I am forced to use the windows version with a db2 database server. This has introduced some interesting problems. After the upgrade from 4.1.2 many query's on most (MOST) table's give this warning: Warning: SQL error: [Microsoft][ODBC Cursor Library] SQLGetData is not allowed on a forward-only (non-buffered) cursor, SQL state SL008 in SQLGetData in f:\inetpub\wwwroot\mr-sales-db2\include\connect.inc on line 21 now I am not sure what a cursor is, how many types of a cursor there are. Maybe somebody could shed some light on this, because I am stuck here. I can post more specifice information if needed. Kind regards, Joop Marijne WebXpose
[PHP-DB] Using OCI, can I retrieve multiple values from DELETE/UPDATE RETURNING?
Using the Oracle OCI interface, as far as I can see if I do the following: $stmt = OCIParse($conn, 'DELETE FROM TITLES' . ' WHERE TAG0' . ' RETURNING ID INTO :T_ID'); there seems to be no way of picking up more than one ID when multiple rows are deleted. The obvious OCIBindByName($stmt, ':T_ID', $t_id, 10); only returns one ID, and not an array of IDs as I might have expected. No other method I can think of is able to return even that! (Including any OCIFetch variation, which doesn't surprise me as they're labelled as being for SELECT results only!) I would be very grateful for any suggestions of how to do this, or confirmation that it can't be done (in which case I'll submit a Feature/Change request to ask for it!). It seems ridiculous that I should have to do a SELECT/DELETE pair, when Oracle provides such a useful feature to get the same result in a single statement. Cheers! Mike Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Beckett Park Tel: extn 4730Fax: extn 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Using OCI, can I retrieve multiple values from DELETE/UPDATE RETU RNING?
On Wed, May 01, 2002 at 12:35:48PM +0100, Ford, Mike [LSS] wrote: Using the Oracle OCI interface, as far as I can see if I do the following: $stmt = OCIParse($conn, 'DELETE FROM TITLES' . ' WHERE TAG0' . ' RETURNING ID INTO :T_ID'); there seems to be no way of picking up more than one ID when multiple rows are deleted. The obvious OCIBindByName($stmt, ':T_ID', $t_id, 10); only returns one ID, and not an array of IDs as I might have expected. No other method I can think of is able to return even that! (Including any OCIFetch variation, which doesn't surprise me as they're labelled as being for SELECT results only!) I would be very grateful for any suggestions of how to do this, or confirmation that it can't be done (in which case I'll submit a Feature/Change request to ask for it!). have you tried an array bind? i have not tries myself, but that would be my 1st guess. see http://conf.php.net/pres/slides/oci/paper.txt for a small sample. It seems ridiculous that I should have to do a SELECT/DELETE pair, when Oracle provides such a useful feature to get the same result in a single statement. bla bla bla... php comes for free - please choose your words a bit more careful, ppls might get offended and not respond to you at all! if you require this feature and it's not in PHP you can: - moan - implement it and keep it private - implement it and give it back to PHP for other ppls to use - find someone who implements it for free - sponsor someone to implement it if you are interested in sponsoring this development please contact me via PM. tc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] convert access to JAVA PHP mysql Xml Soap
Hi We are a publishing company based in London. We have developed a multi-user MS Access contact management and bookkeeping database system which we want to adapt / re-write such that it can be used over the web ( ASP) using Internet Explorer (or similar) from any location, as our clients would like to use it. We are therefore looking for someone to develope or who will head a team of developers and co-ordinate this project. If you are interested in working with us on this, please e-mail [EMAIL PROTECTED] with a brief outline of your knowledge and experience of programming languages and I will get back to you as soon as possible. Jacky Kenna Managing Director, PDA 0207 384 1985 [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Count and group ?
Hi All I have added a row to my table which inputs which admin user has amended a record in a table on my db. I have this working but what I would like to do is count how many instances of the admin id I have stored. So if my list looks like this.. Admin_id 1 2 2 2 3 3 3 3 3 2 1 1 Then the result I would like to display is this.. Admin (1) = 3 posts Admin (2) = 4 posts Admin (3) = 5 posts Basically displaying the total post each admin has made Any help or guidance is very appreciated and thank you in advance Dave Carrera Php Developer http://davecarrera.freelancers.net http://www.davecarrera.com
RE: [PHP-DB] Count and group ?
assuming these are your fields: post_id admin_id code would look something like: ? Mysql_pconnect(host,user,pass); Mysql_select_db(db); $totaladmins=3; For($i=1;$i=$totaladmins;$i++) { $query = select count(post_id) as Admin1 where Admin_id=$i; $result = mysql_query($query); $object = mysql_fetch_object($result); $Admin[$i] = $object - admin_id; print(Admin $i has $Admin[$i] posts.); } ? ___ Ryan Marrs Web Developer Sandler Travis Trade Advisory Services, Inc. 248.474.7200 x 183 248.474.8500 (fax) www.strtrade.com -Original Message- From: Dave Carrera [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 8:03 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Count and group ? Hi All I have added a row to my table which inputs which admin user has amended a record in a table on my db. I have this working but what I would like to do is count how many instances of the admin id I have stored. So if my list looks like this.. Admin_id 1 2 2 2 3 3 3 3 3 2 1 1 Then the result I would like to display is this.. Admin (1) = 3 posts Admin (2) = 4 posts Admin (3) = 5 posts Basically displaying the total post each admin has made Any help or guidance is very appreciated and thank you in advance Dave Carrera Php Developer http://davecarrera.freelancers.net http://www.davecarrera.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Help : search for a word and its number
If I have records like this ID Content 1 John have a red book, and a yellow book. He give a yellow book to Tina. 2 Luke doesn't have any book at all, he always borrow it from John. 3 John like swimming. Can I search this records (table) for a word book and also number of book occurences at every record? From table above, the result would be ID Number 13 21 I use Oracle 8.1.7. I'm not an Oracle expert - you may be able to do the whole thing in SQL - but as a first approximation: SELECT ID, Content FROM MyTable WHERE Content LIKE '%book%' then for each returned record, echo $id. .substr_count($content, book); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Count and group ?
Hi Dave Assuming you are using mysql try the following query select count(Admin_id) as admin1, Admin_id as admin2 from TABLE_NAME group by admin2 substituting TABLE_NAME for whatever you have called your table. Hope this helps Cheers Tony James - Original Message - From: Dave Carrera [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 01, 2002 1:02 PM Subject: [PHP-DB] Count and group ? Hi All I have added a row to my table which inputs which admin user has amended a record in a table on my db. I have this working but what I would like to do is count how many instances of the admin id I have stored. So if my list looks like this.. Admin_id 1 2 2 2 3 3 3 3 3 2 1 1 Then the result I would like to display is this.. Admin (1) = 3 posts Admin (2) = 4 posts Admin (3) = 5 posts Basically displaying the total post each admin has made Any help or guidance is very appreciated and thank you in advance Dave Carrera Php Developer http://davecarrera.freelancers.net http://www.davecarrera.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: How to force a new browser page?
On Wednesday 01 May 2002 08:15, you wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... snip Thanks for the replies on this topis folks. For the moment the form targer=_blank ... will do the job. However, I will certainly try out the other methods suggested. Regards Bob Parker -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Greetings.. MSSQL and PHP question...
I'm toying with this script I found for doing DB queries.. Up until I added the print (TABLE...) and print (/TABLE); code, it worked.. can anyone help me find out what I'm doing wrong? (quoting the bit of the script, so as not to do the TMI bit :) What this does now is give me 560k read and a frozen browser :( Thanks! Glenn snippage... $db = mssql_connect(DB_HOST, DB_USER, DB_PASS) or DIE(DATABASE FAILED TO RESPOND.); $values = array(); if (!empty($where)){ if (!strstr(strtolower($where),where )) $where = where $where; } $query = select $fields from $tables $where $groupBy $orderBy; echo query=$querybrbr\n\n; if ($show_debug == true) echo query=$querybr\n; $stmt = mssql_query ($query, $db) or DIE(Table unavailable); print (TABLE BORDER=1TRTH ALIGN=LEFTCOMPANY/THTH ALIGN=LEFTContact Name/THTH ALIGN=LEFTEmail Address/TH/TR); for ($i = 0; $i mssql_num_rows( $stmt ); ++$i) { $line = mssql_fetch_row($stmt); print(TRTD$line[0]/TDTD$line[1]/TDTD$line[2]/TD/TR); } print (/TABLE); @mssql_free_result ($stmt); @mssql_close($db); return $values; } PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Glenn E. Sieb, System Administrator Lumeta Corp. mailto:[EMAIL PROTECTED] +1 732 357-3514 (V) +1 732 564-0731 (Fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Greetings.. MSSQL and PHP question...
On 12:00 PM 5/1/2002 -0400, Glenn Sieb wrote: I'm toying with this script I found for doing DB queries.. Up until I added the print (TABLE...) and print (/TABLE); code, it worked.. can anyone help me find out what I'm doing wrong? (quoting the bit of the script, so as not to do the TMI bit :) *SNIP* My bad. Apparently this little query pulls out 14,000 lines.. hence the apparent lockup on the browser. A few minutes after posting this I got the page up... Thanks to everyone who posted me privately with hints and tips! :) Glenn --- Glenn E. Sieb, System Administrator Lumeta Corp. mailto:[EMAIL PROTECTED] +1 732 357-3514 (V) +1 732 564-0731 (Fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How do I assign Oracle pakage variable's value to aphp variable?
Hello! Hasn't anyone got this working ? Prince Kumar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... I was thinking the same. But I believe there should be a better way. (We do't want to pass the package variables as OUT variable in a procedure or return them from function, if there are many) I tried this, $sth = OCIParse ( $dbh, begin :myval := mypkg.my_pkg_var; end;); OCIBindByName ( $sth, :myval, $my_val, 10 ); But, didn't work. May be some one here has the solution. Let me know, if you find any goood solution. Thanks, -Original Message- From: Paul Edmondson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 3:52 AM To: Prince Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] How do I assign Oracle pakage variable's value to aphp variable? What a good question. I've just had a quick look around the API and I think the only way would be to write a stored function to return the value. I could not find any functions to bind to those types of values without the stored functions. Have you had any other ideas on how to achieve this? Or even found the solution? On Mon, 2002-04-29 at 20:59, Prince wrote: Hello, I have a package like the following one. creare or replace package my_pkg as my_pkg_var varchar(10) defalut 'myVal'; end my_pkg ; Now, I want to read this value into a php variable (say $my_php_var). How do I do this? in PL/SQL, I can easily do this as declare tmp varchar2(10); begin tmp := my_pkg.my_pkg_var ; end ; / Thanks, -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Paul Edmondson, Software Engineer Yospace: Creating Value for Wireless 7 The Courtyard, High Street, Staines, UK, TW18 4DR Tel: +44 1784 466388 Fax: +44 1784 466387 http://www.yospace.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Global Connection object
Is it possible to make a MySQL connection object global, so that it doesn't need to be declared as a parameter to be accessed from individual functions? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MYSQL: INsert html form data;
I'm not sure what you're asking but the fields are set to varchar(40) which will accommodate the information I have been insertinging... /T on 4/30/02 9:00 PM, Neil at [EMAIL PROTECTED] wrote: Have you checked to see that id tidying is set to the amount equal to the fields in your form. - Original Message - From: Info_Best-IT [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 4:56 PM Subject: [PHP-DB] MYSQL: INsert html form data; I have a problem writing form data to a table in MySQL. I have an action.php file that it called when the information is submitted and it looks something like this: ?php $connection = mysql_connect(@localhost,root, password) or die (The DataBase is Down!); mysql_select_db(web_feedback, $connection) or die (I Can't connect at database!); $query_st_name = mysql_query(INSERT into name_email (col1) values($name)); $query_st_email = mysql_query(INSERT into name_email (col2) values($email)); mysql_close($connection); // Close this connection ? Thanks for submitting your name and e-mail, I will contact you soon to discuss your interest in more detail. I can tell the file is being called since the previous message appears in the window. But when I go to check out my table there are no records. Anyone see where this may be going wrong? I also set a php_error log path in the PHP.ini and I do not get any errors written there. I think it may be something else but not sure what... the site: www.best-it.biz the link: services thanks in advance! /Tim -- 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-DB] Spaces Problem php mysql
I have a form on one server which takes a name in one field, intentionally including spaces as a full name. That value shows up as a form variable as I intended when I display it on the same server. It is sent to another server and written to a mysql database there. At that time, only the first word in the field is written. When the value is returned by the same php script that received and wrote the database, the only thing left in the field is the first word. Length of the word seems to have nothing to do with this. I've been pounding my head (and the keyboard with searches) over this. Do I have to take the first entry apart with string functions to get my desired end, which is the entire name in one field in the database? TIA, Paul -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Spaces Problem php mysql
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I have a form on one server which takes a name in one field, intentionally including spaces as a full name. That value shows up as a form variable as I intended when I display it on the same server. It is sent to another server and written to a mysql database there. At that time, only the first word in the field is written. When the value is returned by the same php script that received and wrote the database, the only thing left in the field is the first word. Length of the word seems to have nothing to do with this. I've been pounding my head (and the keyboard with searches) over this. Do I have to take the first entry apart with string functions to get my desired end, which is the entire name in one field in the database? TIA, Paul You will probably need to urlencode it to pass it, especialy as a GET -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php-db Digest 1 May 2002 19:24:34 -0000 Issue 1181
Hi Dave, The easiest, most direct, ANSI - SQL way to do what you ask is: SELECT count(*) as num_posts, Admin_id FROM your_table_Name WHERE optional but you could narrow the results here GROUP BY Admin_id ORDER BY Admin_id This will give you: num_posts Admin_id - 3 1 4 2 5 3 And naturally you can do whatever you like with these values in your PHP code. The only potential got ya is if you had an Admin_id 4 who had no records you would not get 0, 4 you would not get a row for 4 at all. There is a way around. Ask me if you need it. Also GROUP BY has it's own kind of WHERE clause called HAVING. The WHERTE clause operates on the raw data (like any other query) but HAVING works on the aggregate functions (like count, min, max, ave) so in this example we could add this line right after the GROUP BY: HAVING count(*) 4 This would make the query only return the 5, 3 row. Good Luck, Frank On 5/1/02 12:24 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: Dave Carrera [EMAIL PROTECTED] Date: Wed, 1 May 2002 13:02:51 +0100 To: [EMAIL PROTECTED] Subject: Count and group ? Hi All I have added a row to my table which inputs which admin user has amended a record in a table on my db. I have this working but what I would like to do is count how many instances of the admin id I have stored. So if my list looks like this.. Admin_id 1 2 2 2 3 3 3 3 3 2 1 1 Then the result I would like to display is this.. Admin (1) = 3 posts Admin (2) = 4 posts Admin (3) = 5 posts Basically displaying the total post each admin has made Any help or guidance is very appreciated and thank you in advance Dave Carrera Php Developer http://davecarrera.freelancers.net http://www.davecarrera.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php