RE: [PHP-DB] Persistent Connections to Oracle databases
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 11 November 2004 19:11, Patrick David wrote: My understanding of persistent connections was that using the ociplogon function a connection would be opened to the database and all other connections to the same database (with the same username and password) would use the first one previously opened, which mean I would have only 1 connection to the database. I know this is a late response, but I haven't seen anybody point this out yet: that's 1 connection *per Apache child process*, since each process still has to have its own connection. But in fact it is not what is happening, every time I submit the page to the same database a new connection is opened. Which is a little bit annoying if I submit this one 100 times (100 connections at the end). Potentially, if you have Apache configured to run 100 children or more. If you configure it to run only 50 children, that's the maximum number of Oracle connections you will get. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Replacing subtring within table record
I want to replace one substring with another within a MySQL table record, eg a blob. Do I need to extract the record and do it in php or can I do it directly with mysql? The Replace Syntax notes in mysql.com seem to relate to replacing the whole row and I'm not quite confident with shell commands. John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] multiple returned lob resource being overwritten in oci8
Hi, I am selecting multiple columns from a table, one being a clob. the query returns multiple records for the query. The results are all good, except the clob column. The last returned record's clob column overwrites all previous clob columns (all the previous records have there unique data, except the clob columns which contains the data for the last record across all previous records), depending on how I fetch the data. A working example: $query = 'select id, author, cdate, views, title, message, top from APP_THREADS where TYPE = \'D\''; $stmt = ociparse($fw_db-connection, $query); ociexecute($stmt); while (OCIFetchInto ($stmt, $row, OCI_ASSOC)) { echo $row['MESSAGE']-load(); } with the output being something like this: clob1 clob2 clob3 clob4 All good. But, if I don't grap the lob output right away, and do some other assignement work on the result before hand, the above explained issue takes shape. The issue, after some testing, appears to be how the oci8 function stores the clob resource. The following code results in this problem: $query = 'select id, author, cdate, views, title, message, top from APP_THREADS where TYPE = \'D\''; $stmt = ociparse($fw_db-connection, $query); ociexecute($stmt); while (OCIFetchInto ($stmt, $row, OCI_ASSOC)) { $messages[] = $row['MESSAGE']; } foreach ($messages as $message) { var_dump($message-load()); } with the output being: clob4 clob4 clob4 clob4 In this example the lob resources are overwritten when you loop through the result set the first time around, resulting in all fetched lobs returning the value of the last lob in the result set. The question is: is this an oci8 bug or just how things have to be done? Thanks, Michael
Re: [PHP-DB] Upgrading mySQL
when I go to both 2.10 Upgrading MySQL (http://dev.mysql.com/doc/mysql/en/Upgrade.html) and 2.10.2 Upgrading from Version 4.0 to 4.1 (http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html) it does not tell me how to upgrade it only tells me about important changes and recomendation. I am looking for a guide of what commands I need to use and so forth. As I said in the inital mailing I made, I am a newbie to Linux. It also says that It is a good idea to rebuild and reinstall the Perl DBD::mysql module whenever you install a new release of MySQL. The same applies to other MySQL interfaces as well, such as the PHP mysql extension and the Python MySQLdb module. [But now how to] Please Assist... Thank You. On Sun, 14 Nov 2004 19:55:52 -0800, Ardilla Roja [EMAIL PROTECTED] wrote: this one will be usefull ... 2.10.2 Upgrading from Version 4.0 to 4.1 - http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html On Sun, 14 Nov 2004 09:30:49 -0500, GH [EMAIL PROTECTED] wrote: I would like to know how to upgrade mySql from 4.0 to 4.1? I am running mandrake 10 I am using the preinstalled versions of both mySQL and PHP (php4). I am a newbie to Linux and am a bit nervous. Thanks. -- 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] Problem with an insert query
On Saturday 13 November 2004 20:25, GH wrote: Explain Bind Vars please... Thanks It is a technique for preparing an SQL statement with placeholders which can then be substituted with values when the statement is executed. It will be unavailable to you unless you are using MySQL 4.1.3 or above and are using the mysqli library. See: http://www.php.net/manual/en/function.mysqli-prepare.php Note, this is a common technique in database programming but one which MySQL is only just starting to adopt... Simon -- ~~ Simon Rees | [EMAIL PROTECTED] | ORA-03113: end-of-file on communication channel ~~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP vs ASP
I need some ammo to convince my boss not to use ASP but use PHP instead. Anyone have some info I can give him? - Matthew
Re: [PHP-DB] PHP vs ASP
On Mon, 2004-11-15 at 10:20 -0600, Perry, Matthew (Fire Marshal's Office) wrote: I need some ammo to convince my boss not to use ASP but use PHP instead. Anyone have some info I can give him? - Matthew PHP = free ASP = not PHP = most widely used scripting language online PHP5 is out PHP = tons of open source libraries..free to download -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
RE: [PHP-DB] PHP vs ASP
From: Perry, Matthew (Fire Marshal's Office) [mailto:[EMAIL PROTECTED] I need some ammo to convince my boss not to use ASP but use PHP instead. Anyone have some info I can give him? If you want us to give you live ammo instead of blanks, we'll need more details on your setup. There is a possibility that you should use ASP instead of PHP, albeit slim. Things like: What languages the coder(s) already know What code is already in place What kind of interfacing will you be doing (what data sources, etc.) if any What type of server it's running off Etc. You can certainly start off with apache+php is going to be cheaper than anything else (assuming you or someone else know the particulars already). It's no longer the case that bosses will complain that if you leave no one can maintain it! - PHP is definitely here to stay and pretty mainstream. - Martin Norland, Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] PHP vs ASP
These are some good points. My gut reaction is similar to Robby's, but here are the points he made: PHP = free ASP = not PHP = most widely used scripting language online PHP5 is out PHP = tons of open source libraries..free to download ASP comes free with PWS and IIS. So if you're already in a Microsoft environment, then PHP vs ASP as far as cost goes isn't a factor. PHP most widely used scripting language? I did some research on this (because I, myself, had a convince my Boss session a little while ago.. Which I'm never going to do, but I wanted to at least arm myself a little bit) and I found some surveys and the general breakdown seemed to be: IIS = 1/3 of the servers online (roughly) Apache = 2/3 of the servers online (roughly) PHP = 45+% of the primary scripting on Apache servers. Assuming ASP is used on 100% of the IIS boxes (or close to it), that puts PHP and ASP almost dead even on usage. I'm sure it sways depending on the survey, winds, alignment of the planets, etc. I don't think we'll ever get a fair, unbiased survey of such things. So that point is semi-debateable. The idea that they're neck and neck is encouraging though. PHP5 vs ASP, ASP.NET, or other current flavors of ASP.. I don't have direct head to head comparisons, but this seems to be a subjective measurement of worth. Tons of open source libraries,etc...There's a lot of sites devoted to posting code snippets and even full applications. Many for ASP as well as PHP. I think PHP's uniformity helps find useful code, whereas when I look for ASP stuff, I get ASP, ASP.NET (VB), ASP.NET (C#) and other mish-mashes of code samples. But there's certainly not a lack of ASP online resources. So back to Martin's post, these are definitely points to consider. Do you have in-house coders who already know something (that's the battle I fight right now. I'm the only PHP guy and we have at least two ASP.NET coders and another couple of VB or other MS based coders that could probably do the ASP.NET if needed.. So I'm outnumbered on that one). Do you have existing code that would have to be ported to PHP or would you have to support two different scripting languages (most companies prefer not to do this if they can help it). Will it be web based or do you desktop applications (where a VB.NET or some kind of Visual Studio compiled and developed application type language would be better than PHP... At least until WinBinder gets fully going hah). Server... Yes.. Do you already have a server? Do you have people that know Apache? Do you already have IIS running?If you're a small shop, these things could change on a whim, if you have a larger user base where even small changes can affect a lot of people, these can be very heavy considerations. I love developing in PHP, but there's no use trying to teach a pig to sing If you work for a pig, then you gotta learn to grunt and just use whatever they tell you to use. Don't force a change that's going to create a lot of problems, downtime, etc. Free is only free if you either don't have anything already or you have coders and servers that are already in-line with the new plan. If you take a bunch of ASP programmers and force them to learn PHP, then you have a learning curve, code porting and other things that can cost the company money and possibly create downtime or project delays. This makes Apache + PHP changover hardly free to the company. -TG -Original Message- From: Norland, Martin [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 11:29 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] PHP vs ASP From: Perry, Matthew (Fire Marshal's Office) [mailto:[EMAIL PROTECTED] I need some ammo to convince my boss not to use ASP but use PHP instead. Anyone have some info I can give him? If you want us to give you live ammo instead of blanks, we'll need more details on your setup. There is a possibility that you should use ASP instead of PHP, albeit slim. Things like: What languages the coder(s) already know What code is already in place What kind of interfacing will you be doing (what data sources, etc.) if any What type of server it's running off Etc. You can certainly start off with apache+php is going to be cheaper than anything else (assuming you or someone else know the particulars already). It's no longer the case that bosses will complain that if you leave no one can maintain it! - PHP is definitely here to stay and pretty mainstream. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] IIS and php sessions
Hey everyone, I'm trying to migrate this php app with a mySQL database to IIS/Microsoft SQL Server. I know that I should be using a database abstraction layer but haven't had the time to do that just yet. In anycase, the question has little to do with that. I'm trying to get sessions in php working on IIS and I've noticed that that needs to be configured manually for IIS. But what exactly does that mean? I can't find a good step by step source about this issue so any help would be greatly appreciated. thx Adil. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] IIS and php sessions
From: Adil [EMAIL PROTECTED] I'm trying to get sessions in php working on IIS and I've noticed that that needs to be configured manually for IIS. But what exactly does that mean? I can't find a good step by step source about this issue so any help would be greatly appreciated. 1. Ensure session.save_path is valid in php.ini (ensure the directory exists and that's where you want to save session files) 2. Ensure the IUSR_computer_name user has access to read and write to the directory in session.save_path. PHP runs as the IIS user when installed as a module, which is the IUSR_computer_name user by default 3. Sessions should work. Run a simple test to find out. ?php session_start(); $_SESSION['count']++; echo You've been here {$_SESSION['count']} times.; ? Any issues, let me know. ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html replyAll Description: null -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] IIS and php sessions
I'm pretty sure this is enabled by default in PHP for Windows, I think you'll need to check the IUSR_[machine_name] persmissions on the sessions folder. I'm headed in the other direction. I'm re-writing an app with a database abstraction layer with hopes of moving to postgres. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] IIS and php sessions
Hi Adil, You need to configure session.save_path in php.ini. This setting needs to point to a directory where the IIS user can write files. If you are running the ISAPI version of php you also need to restart the web service for the changes to take place. - Frank Hey everyone, I'm trying to migrate this php app with a mySQL database to IIS/Microsoft SQL Server. I know that I should be using a database abstraction layer but haven't had the time to do that just yet. In anycase, the question has little to do with that. I'm trying to get sessions in php working on IIS and I've noticed that that needs to be configured manually for IIS. But what exactly does that mean? I can't find a good step by step source about this issue so any help would be greatly appreciated. thx Adil. -- 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] IIS and php sessions
save path variable for sessions by default is /tmp which is a linux default try changing it to /temp bastien From: John Holmes [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Adil [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP-DB] IIS and php sessions Date: Mon, 15 Nov 2004 16:01:47 -0500 From: Adil [EMAIL PROTECTED] I'm trying to get sessions in php working on IIS and I've noticed that that needs to be configured manually for IIS. But what exactly does that mean? I can't find a good step by step source about this issue so any help would be greatly appreciated. 1. Ensure session.save_path is valid in php.ini (ensure the directory exists and that's where you want to save session files) 2. Ensure the IUSR_computer_name user has access to read and write to the directory in session.save_path. PHP runs as the IIS user when installed as a module, which is the IUSR_computer_name user by default 3. Sessions should work. Run a simple test to find out. ?php session_start(); $_SESSION['count']++; echo You've been here {$_SESSION['count']} times.; ? Any issues, let me know. ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html Hey everyone, I'm trying to migrate this php app with a mySQL database to IIS/Microsoft SQL Server. I know that I should be using a database abstraction layer but haven't had the time to do that just yet. In anycase, the question has little to do with that. I'm trying to get sessions in php working on IIS and I've noticed that that needs to be configured manually for IIS. But what exactly does that mean? I can't find a good step by step source about this issue so any help would be greatly appreciated. thx Adil. -- 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
[PHP-DB] PHP / Javascript question
Hi there everyone, I have a form with check boxes and with PHP I use the array feature for the form name. Now I need to check if the tickboxes are ticked and if not return an error, normally with javascript I would use: script language=JavaScript function validate_form ( ) { valid = true; if ( document.removeitems.del.value == ) { alert ( You cannot remove an item if it is not selected. ); valid = false; } return valid; } /script BUT because the tickboxes information is stored in a PHP Array called del[] I am having major problems getting it to work. Does anyone know how to determine with javascript if any boxes are ticked, when the name for the box is an Array such as del[] ??? Im grabbing the data from my MySQL DB without a hitch etc . And I know technically this is more MySQL / PHP list, but it is related and Ive looked online and cant seem to find anything, so thought Id try here as usually you are all very helpful. Thank you Chris --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.795 / Virus Database: 539 - Release Date: 11/12/2004
Re: [PHP-DB] PHP / Javascript question
On Tuesday 16 November 2004 11:03, Chris Payne wrote: BUT because the tickboxes information is stored in a PHP Array called del[] I am having major problems getting it to work. Does anyone know how to determine with javascript if any boxes are ticked, when the name for the box is an Array such as del[] ??? manual PHP and HTML -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* Stone's Law: One man's simple is another man's huh? */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP / Javascript question
Hi there everyone, I have a form with check boxes and with PHP I use the array feature for the form name. Now I need to check if the tickboxes are ticked and if not return an error, normally with javascript I would use: script language=JavaScript function validate_form ( ) { valid = true; if ( document.removeitems.del.value == ){ alert ( You cannot remove an item if it is not selected. ); valid = false; } return valid; } /script BUT because the tickboxes information is stored in a PHP Array called del[] I am having major problems getting it to work. Does anyone know how to determine with javascript if any boxes are ticked, when the name for the box is an Array such as del[] ??? Im grabbing the data from my MySQL DB without a hitch etc . And I know technically this is more MySQL / PHP list, but it is related and Ive looked online and cant seem to find anything, so thought Id try here as usually you are all very helpful. Thank you Chris + Hey Chris So, PHP creates HTML and Javascript on the server end. Javascript is read in the browser. By the time the Javascript gets to do checks to see whether a box is pressed or not, the PHP array is long-gone. You should run your PHP, and then check the source code it makes in the browser. What you'll hopefully see is a bunch of form boxes with the names they got from the array. So, use Javascript to check those names. If your list is dynamic, so there might be del1, del2, del3, etc., you'll want to use a loop in Javascript to run through the names. To find out how many there are for the loop, PHP can dump a javascript variable called loopAmount or something. Luck. Gabino -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php