[PHP-DB] Re: Problems with 4.3.10 and SQL Server

2005-03-18 Thread John Lim
Hi

There are serious bugs in mssql support in 4.3.10. Get the latest snapshot 
from CVS and update php_mssql.dll

http://snaps.php.net/

"Aifoundations.Org" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I don't see many SQL Server posts here but I will give it a shot. I am
> using PHP 4.3.10, SQL Server 2000, and W2000.
>
> I have had no problems with scripting against PHP 5.x but I have had
> real problems when running these same scripts against 4.3.10.
>
> For example, all my select and insert statements do nothing.
> Submitting truncate commands against the database work, but a simple
> query like "insert into input values('$lines')" do nothing. Again, I
> have had no problems with 5.x. Any general suggestions or tricks to
> try. I have tried things such as fully quoting table names, bracketing
> the name, using 2 single quotes instead of 1. None of these
> suggestions work however.
>
> Jim 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] php v jsp

2004-11-20 Thread John Lim
See  http://peteryared.blogspot.com/2003/09/next-language.html.
Peter Yared was formerly CTO for Sun's Application Server groups.
He has rejected JSP/J2EE and is now advocating solutions such as PHP.

Pretty damning, given Peter's background:

" The Java API’s grow into a morass of inconsistent and incomprehensible API’s, 
even the most simple things proved to be very complicated. The vast majority 
of J2EE deployments (over 80% according to Gartner) are simply Servlet/JSP 
to JDBC applications. Basically HTML front-ends to relational databases. It 
is ironic that much of what makes Java complicated today is all of its 
numerous band-aid extensions, such as generics and JSP templates, which were 
added to make these types of simple applications easier to develop. "

"John Holmes" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Vikas Nanda wrote:
>
>> I just wanted to know what the advantages are of using php against jsp. 
>> My supervisor wants me to use jsp but I think that php might be
> > better. Also can php code be easy reused like jsp?
>
> Why would you think such a thing? They both accomplish the same mission 
> using similar strategies. A competant JSP programmer is going to make a 
> better program than a newbie PHP programmer and vice versa.
>
> Which programming language do you know? What kind of hardware are you 
> using? How many programmers are on your team? What kind of program are you 
> developing?
>
> The question isn't as simple as JSP vs. PHP vs. .NET, etc, many other 
> things need to be taken into consideration, too. You may just have to 
> accept that JSP is a better solution in this instance. Or you may weigh 
> all of the above and decide it'd be stupid to not use PHP.
>
> -- 
>
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: oci8 cannot connect after restarting DB

2004-11-18 Thread John Lim
Michael,

After rereading your post again, i realise you mentioned it's happening with 
non-persistent connections also. That puzzles me. Perhaps we are talking 
about multiple bugs here. In general, I have not found PHP5 and oci8 to be 
very stable, and would not recommend moving anything production to use PHP5 
just yet.

Regardsd, John

"John Lim" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi
>
> This is because you are using persistent connections, which are
> left dangling and do not restart after the database restarts.
> Apparently you can hack your tnsnames.ora or oci8 extension.
>
> See http://bugs.php.net/bug.php?id=15390
>
> and http://bugs.php.net/bug.php?id=30808
>
> Regards, John
>
> "Michael Caplan" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Every evening, for whatever reason, our Oracle db (9.2.0) is restated.
>> After it is restarted, I am unable to build a connection with Oracle from
>> PHP untill Apache is restarted.
>>
>> Whenever I do an ociplogon() or ocilogon() following an Oracle DB 
>> restart,
>> it fails but I am unable to get a description of the error.  Restarting
>> Apache "fixes" the problem.
>>
>> Has anyone else experianced the same issue?  It appears to me that this 
>> is a
>> php oci8 bug.  (shouldn't a new connection be built if a persistant
>> connection fails, and if not using persistant connections, shouldn't this 
>> be
>> a non issue?)
>>
>> Thanks,
>>
>> Michael
>>
>> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: oci8 cannot connect after restarting DB

2004-11-17 Thread John Lim
Hi

This is because you are using persistent connections, which are
left dangling and do not restart after the database restarts.
Apparently you can hack your tnsnames.ora or oci8 extension.

See http://bugs.php.net/bug.php?id=15390

and http://bugs.php.net/bug.php?id=30808

Regards, John

"Michael Caplan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Every evening, for whatever reason, our Oracle db (9.2.0) is restated.
> After it is restarted, I am unable to build a connection with Oracle from
> PHP untill Apache is restarted.
>
> Whenever I do an ociplogon() or ocilogon() following an Oracle DB restart,
> it fails but I am unable to get a description of the error.  Restarting
> Apache "fixes" the problem.
>
> Has anyone else experianced the same issue?  It appears to me that this is 
> a
> php oci8 bug.  (shouldn't a new connection be built if a persistant
> connection fails, and if not using persistant connections, shouldn't this 
> be
> a non issue?)
>
> Thanks,
>
> Michael
>
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-12 Thread John Lim
Hi Hans,

The case-changing code for postgresql is in the postgres7 driver.

Regards, John


"Hans Lellelid" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi John,
>
> John Lim wrote:
>>>/abstract/ stuff.  For example, ADOdb would completely fail to be 
>>>portable accross databases where the case of the column names in result 
>>>array changes (e.g. postgres always returns lowercase col names, Oracle 
>>>always uppercase, MySQL returns mixed case, SQLite is configurable). This 
>>>is one example of why some layers (like PEAR::[M]DB) may be slower.
>>
>> Hans,
>>
>> This is incorrect. You can configure the case of the column names in 
>> ADOdb. See 
>> http://phplens.com/adodb/reference.constants.adodb_assoc_case.html
>>
>> Regards, John
>
> Sorry about that.  I certainly don't want to spread disinformation (!) Is 
> this true for all the drivers ... ?  E.g. I looked at the postgres64 
> driver and saw no case-changing code in the MoveNext() method; I didn't 
> look at the other drivers after that, though.
>
> Cheers,
> Hans 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-09 Thread John Lim

"Hans Lellelid" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]


> /abstract/ stuff.  For example, ADOdb would completely fail to be portable 
> accross databases where the case of the column names in result array 
> changes (e.g. postgres always returns lowercase col names, Oracle always 
> uppercase, MySQL returns mixed case, SQLite is configurable). This is one 
> example of why some layers (like PEAR::[M]DB) may be slower.
>


Hans,

This is incorrect. You can configure the case of the column names in ADOdb. 
See http://phplens.com/adodb/reference.constants.adodb_assoc_case.html

Regards, John 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Limiting persistant connections with IIS

2004-08-11 Thread John Lim
Hi

Remember that odbc supports connection pooling. Use non-persistent
connections in PHP, and switch to odbc connection pooling.

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm running a PHP app on windows 2000 / IIS using unified ODBC to
> connect to MS-SQL. I would like to connect to the database using
> persistant connections but need to limit the total number of
> connections to avoid swamping the database. It seems that a new
> connection is created for every request made to the webserver at
> least for the first few tens of requests - presumably a new php
> thread is being created for each request.
>
> I've tried limiting the maximum connections allowed by IIS for
> the website - but this does not appear to affect the number of PHP
> threads holding persistant connections to the db.
> I have set odbc.max_links in the php.ini file in case it is a bug
> in my program opening lots of connections but with maximum connections
> for IIS being set to 20 and max_links 4 I still end up with several
> hundred database connections after a few hundred page requests.
>
> If I was implementing this on apache (which I have much more experience
> of using) I would use the MaxClients directive to achieve this...
>
> Does anyone know how to limit the number of persistant database
> connections on windows/IIS/PHP?
>
> cheer 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] Re: Postgres Issues

2004-07-17 Thread John Lim
Jake,

I said it was a postgresql problem. Please don't misquote me.

http://phplens.com/lens/lensforum/msgs.php?id=10131

"Jake Stride" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am having some problems with postgresql/adodb. I keep getting the
> following error with some of my queries that use bigserial:
>
> Warning: pg_exec(): Query failed: ERROR: operator does not exist: bigint
=?
> HINT: No operator matches the given name and argument type(s). You may
need
> to add explicit type casts.
>
> The guys at adodb say this is a PHP issue but I find it hard to believe I
am
> the first person every to use the bigserial type!
>
> Any pointers gratefully received.
>
> Jake

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] ADOdb db abstraction library moving to sourceforge

2004-06-15 Thread John Lim
Hello,

ADOdb is a popular database abstraction library for PHP.  It supports
a very large number of databases, including MySQL, PostgreSQL,
Firebird, Interbase, SQLite, Oracle, Frontbase, DB2, SAP DB, Sybase,
Informix, Netezza, Access, VFP, MS SQL, LDAP, ODBTP, ODBC, etc.

Due to system outages at the current site, the home page of ADOdb
has moved to sourceforge.

Kindly update your links to

http://adodb.sourceforge.net/

Given the move to sourceforge, we have decided to take advantage
of its services and we have created 2 new mailing lists:

adodb-news: low volume moderated list for important news
http://lists.sourceforge.net/lists/listinfo/adodb-news

adodb-general: for general postings
http://lists.sourceforge.net/lists/listinfo/adodb-general

Bugs should still be reported at the existing forums at
http://phplens.com/lens/lensforum/topics.php?id=4

Thank you.

John Lim

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] win32 Timestamp problem

2004-03-10 Thread John Lim
Hi,

See http://php.weblogs.com/adodb_date_time_library

I wrote this to fix this problem.

INTRODUCTION

PHP native date functions use integer timestamps for computations. Because
of this, dates are restricted to the years 1901-2038 on Unix and 1970-2038
on Windows due to integer overflow for dates beyond those years. This
library overcomes these limitations by replacing the native function's
signed integers (normally 32-bits) with PHP floating point numbers (normally
64-bits).


"Mike Ford" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 09 March 2004 20:36, J. Kevin C. Burton wrote:
>
> > Hey all, after reading documentation on the Win32 bug
> > regarding Timestamps
> > not being able to go prior than 1970..
> >
> > I am in need of a way to calculate someone's age.
> >
> > Has anyone found a fix or workaround for this bug? Or a way
> > to calculate age
> > without using the timestamp?
> >
> > They say that v5 of PHP will fix this issue, but I've been using every
> > stable release of PHP5 and it's a no go.
>
> No, it won't.  It's an operating system issue, and nothing PHP *can* fix.
>
> > Any help would be appreciated.
>
> Have you looked at the Calendar extension? http://www.php.net/calendar
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, 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] Re: Re:Firts time user of adodb

2004-02-25 Thread John Lim
You should have seen the SELECT stmt being outputed when debug is enabled.

If you saw nothing, then the connect() failed. Make sure you turn on error
reporting with

error_reporting(E_ALL);

before you connect.

"-* Nadine *-" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanx, I tried that but it didn't show anything :(
>
> ...
> Hi Nadine,
>
> Turn on debugging. Eg.
>
> $db = ADONewConnection('access');
> $db->debug = 1;
>
> _
> Get fast, reliable access with MSN 9 Dial-up. Click here for Special
Offer!
> http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Firts time user of adodb

2004-02-24 Thread John Lim
Hi Nadine,

Turn on debugging. Eg.

$db = ADONewConnection('access');
$db->debug = 1;

"-* Nadine *-" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
> I'm a new member to the list and using php of rthe first time. I have
> decided to use adodb so I can make a dsn-less connection to an access
> database.
> I have managed to get my script to run without errors but thats all
I've
> tried using a Select statement but it does nothing...
> here's my code:
>
> 
> include("adodb/adodb.inc.php"); // includes the adodb library
> $db = ADONewConnection('access');
> $dsn = "Driver={Microsoft Access Driver
>
(*.mdb)};Dbq=http://student.dcu.ie/Project/XtraVision.mdb;Uid=Admin;Pwd=;";;
> $db->Connect($dsn);
>
> $sql = "SELECT Surname, City FROM Member";
> $rs = &$db->Execute($sql);
> if (!$rs)
> {
> echo $db->ErrorMsg(); // Displays the error message if no results could be
> returned
> }
> else
> {
> while (!$rs->EOF)
> {
> echo $rs->fields[0].' '.$rs->fields[1].''; // fields[0] is surname,
> fields[1] is age
> $rs->MoveNext(); // Moves to the next row
> } // end while
> } // end else
>
>
>
> ?>
>
> Thanx in advance :)
>
> _
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: PHP 4.2.1 and Oracle9i

2003-05-31 Thread John Lim
Hi Robert

Yes oci8 functions work fine with Oracle9i.

"Robert Varner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can anyone tell me whether PHP 4.x will continue to operate with Oracle9i
> using the PHP OCI calls?  I understand that PHP may have to be recompiled
> again for Oracle9i.
>
> [EMAIL PROTECTED]
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: COM

2003-03-29 Thread John Lim
Hi Kiswa,

You are using mixing programming styles incorrectly.

"Kiswa" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Server Win2000 +ISS5 +PHP
> Trying to get access to an access DB through COM but i wont work. there is
> no results generated.
> Can anyone help me
> Here is the code
>
> $rownum =0;
> $conn = &ADONewConnection('access');
> $conn->PConnect('webdb.mdb');
> $result = &$conn->Execute('SELECT Produkt, Artikelnr, Pris, Lagerstatus,
> Beskrivning, Kategori, Bild FROM Data');

Using ADOdb
>
>   while(odbc_fetch_row($result)){
>   $Produkt = odbc_result($result, Produkt);
>   $Artikelnr = odbc_result($result, Artikelnr);
>   $Pris = odbc_result($result, Pris);
>   $Lagerstatus = odbc_result($result, Lagerstatus);
>   $Beskrivning = odbc_result($result, Beskrivning);
>   $Kategori = odbc_result($result, Kategori);
>   $Bild = odbc_result($result, Bild);

Then using native odbc, which will not work because $result is an ADOdb
recordset,
and not odbc resultid.

Hope this helps. John

PS: ODBC does not use COM.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Cross-Table

2003-03-22 Thread John Lim
Hi

The ADOdb db abstraction library has support for cross-tables (pivot
tables).

http://php.weblogs.com/adodb

"Blain" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does anyone have some experience with cross-tables?
>
> Thanks for help
>
> Blain
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: ROugh idea of speed

2002-11-08 Thread John Lim
Hi,

I've dealt with databases with about 100 million records
(100Gb of data/indexes), using Oracle, and i'm glad we did.
If you database is 5 times larger than our largest one, you definitely
you need Oracle or something high end.

"Steve Vernon" <[EMAIL PROTECTED]> wrote in message
news:030801c2872e$2d8065f0$f6ef87d9@;extreme...
> Hiya,
> Just wondering what is the rough idea of speed of a server like this
is
> holding a database with millions of records. I know its difficult, depends
> on the data stored etc.
>
> Its basically storing an index int and about 5 or so char field (50
> long). In total I want to store 500 million records. Accessed using PHP.
>   a.. 2x Intel Pentium III 1260 CPU or higher

Sounds good.

>   b.. 1 GB RAM

That's not much RAM for a database that size. However it could
be adequete.

>   c.. 60 GB hard drive

In general you need at least 3-4 times the hard disk space required
for you data for indexes, temp storage and growth.

>   d.. 20 GB traffic/month
>   e.. RedHat LInux 7.2

Red Hat Advanced Server is better - it has Oracle patches for better
asynch i/o performance.

> Ive read that its better to store the data in different databases on
the
> same server?
>

You probably mean store the data on multiple hard disks. That's good.
Different db's make little sense.

> Can someone please give me a rough idea of the speed and how many
> servers needed, my client wants to know how much it will cost to host the
> site.
>
>  Anyone have any experience with holding a lot in MySQL? Any idea of
> speed would be great.
>

A bad idea. We also use and like MySQL, but definitely this is
a different league. Also get a good DBA, you sound as if you will need one.

Doing such databases can be very profitable (if you are the vendor), but
you need to get some skilled people to work with you. The selection of
hardware available for the task is very wide depending on your
price/performance. Hardware vendors such as IBM and HP are
Linux friendly and have the expertise to advise you better. Don't ask
box pushers like Dell - they don't have the right knowledge.

Regards, John

> Thanks,
>
> Steve
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Accessing Foxpro free tables using ODBC

2002-09-30 Thread John Lim

Hi Yue Teng,

Right click on the directory in Explorer and change the NTFS permissions as
appropriate. If you are not sure, set it to read/write Everyone. Best of
luck-lah!

John

"Yue Teng" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi John,
>
> It could be a file permissions issue. I ran the script using PHP from
> XP's command prompt window and the output is fine. The problem
> occurs only when test.php is served by Apache.
>
> How should I grant the permissions? Do I modify php.ini or Apache's
> httpd.conf file?
>
> "John Lim" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hi
> >
> > Looks like a file permissions problem perhaps. Grant access to the the
IIS
> > user or make the file public to everyone.
> >
> >
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Accessing Foxpro free tables using ODBC

2002-09-29 Thread John Lim


"Yue Teng" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear All,
>
> Warning: SQL error: [Microsoft][ODBC Visual FoxPro Driver]Cannot open file
> c:\web\data\dblist.dbf., SQL state S1000 in SQLExecDirect in
c:\web\test.php
> on line 10
>
> Since the same ODBC DSN can be accessed from other programs, is it
> possible that I have left out something when configuring PHP?
>

Hi

Looks like a file permissions problem perhaps. Grant access to the the IIS
user or make the file public to everyone.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Searching for Datagrid

2002-09-24 Thread John Lim


"Paolo Zani" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi All!
> I'm searching for Datagrid component for php and mysql. Something like
java
> ones.
> Does anyone knows one?
>
> Thanks
> Paolo
>
>

Have a look at http://phplens.com/ It's a commercial software component.

Regards, John



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] mySQL max connections

2002-07-31 Thread John Lim

Hello Rasmus,

Sorry to bother you, but lerdorf.com is currently down.

Regards, John

PS: I have been reading your new Programming PHP book. I love it!

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I would suggest looking into MySQL's replication support.  Split reads and
> writes so they go to separate servers.  That is, create a master server
> where you send all database writes.  And do all reads on the replicated
> slave servers.
>
> Have a look at this presentation I gave last week on this stuff:
>
> http://pres.lerdorf.com/show/osconmysql
>
> The last couple of slides should be interesting to you.
>
> (works best with Mozilla, click on the yellow text at the top to change
> slides, or use cursor-right/left)
>
> -Rasmus
>
> On Tue, 30 Jul 2002, Shane Wright wrote:
>
> > Hi
> >
> > I have a database thats taking a bit of a hammering - enough so that the
> > number of connections spirals up and out of control.
> >
> > max_connections was originally at the default of 100 - but rising above
50 or
> > so meant actual throughput dropped so the db never got a chance to keep
up
> > (meaning manually restarting the db).  I've lowered max_connections to
40
> > which at least keeps the db alive.
> >
> > But, the number of connections keeps rising to and bouncing off this
limit -
> > and for the users that hit it a 'Too many connections' error is given.
> >
> > Now, I've optimised everything as much as is humanely possible - and the
only
> > way out I can see so far is to have some kind of connection queue to
keep
> > people waiting for the 1/2 second or so until the load spike drops off
(I'd
> > rather have a few slow pages than errors any day).
> >
> > Is there any way of doing this - I've looked at back_log (the listen()
> > backlog), but that doesnt really apply.
> >
> > Short of writing a 'hide-warning-wait-a-bit-and-try-again' chunk in PHP
> > (sucky!) I'm stuck!
> >
> > Using persistent connections doesn't stunningly help either - it only
gives a
> > small performance increase
> >
> > Any help appreciated, thanks.
> >
> > --
> > Shane
> > http://www.shanewright.co.uk/
> > Public key: http://www.shanewright.co.uk/files/public_key.asc
> >
> > --
> > gpg: Warning: using insecure memory!
> > gpg: Signature made Tue 30 Jul 2002 04:25:04 AM PDT using DSA key ID
D08C06B4
> > gpg: Can't check signature: public key not found
> > --
> >
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: DB400 on AS/400

2002-06-24 Thread John Lim

Hi Mike

I have heard  successful reports of using odbc to connect to db400. I have
not personally done so.

Regards, John

"Mike Germain" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to do a query on a database on an AS/400. The database is in
> DB400 format which is simaluar to DB2. Can PHP access databases in DB400
via
> ODBC or does it only work in DB2?
> thx,
> Mike
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: sql standard

2002-06-24 Thread John Lim

In general, columns are case-insensitive in every relational database I have
tried. However table names might not be.

Regards, John

"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hope someone can confirm this.
> I was moving a mysql dump to postgresql, and I had 2 tables with MiXeD
> upper/lower case letters, that
> got converted to lowercase.  I found a discussion that sql
> column/table/database names should be lowercase.
> Just trying to keep in line with a standard.
> Thanks
>
> --
> Gerard Samuel
> http://www.trini0.org:81/
> http://dev.trini0.org:81/
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Whats more efficient....?

2002-06-24 Thread John Lim

Hi,

In a server farm, it depends on which machine has the lighter load, MySQL
or PHP.

If you are talking about running on the same machine, probably joining in
MySQL would be faster as it is optimized C code, while PHP is still running
in a virtual machine.

In general, benchmarks are the best test as above a just generalizations.

Regards, John

"Matthew Nock" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is it more efficient to run a SELECT query on a MySQL database that
> retrieves maybe 100 records from approximately 6 tables (based on one
> result - such as a product ID) and then process these results using
PHP
>
> or is it more efficient to run say 6 SELECT statements that get the exact
> details we want, and in the process returning a smaller number of results
> over all?
>
> If its the first of the two, then is it possible to use the MySQL "Group
by"
> structure to group the results, and store the results of each "group" (for
> example a product category) in separate arrays?
>
> ie;  array_prodcat1, array_prodcat2 etc etc?
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: is there a php connectivity for db2?

2002-05-17 Thread John Lim

Forgot to mention, see http://www.php.net/manual/en/ref.odbc.php

"Jagannath Nori" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi,
>
> I started with a demo version of a module.  Wrote  the application with
php
> & mysql.
>
> The original data is in mainframe & the database is db2.  Can I talk to
db2
> using php?
>
> Regards,
> Jagan
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: is there a php connectivity for db2?

2002-05-17 Thread John Lim

Hi jagannath,

Yes, thru ODBC.

Regards, John

"Jagannath Nori" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi,
>
> I started with a demo version of a module.  Wrote  the application with
php
> & mysql.
>
> The original data is in mainframe & the database is db2.  Can I talk to
db2
> using php?
>
> Regards,
> Jagan
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] ODBC problem in 4.2.0

2002-04-30 Thread John Lim

Hi Ryan,

Don't be hasty. What i'm simply saying is that QA is a process and you
need to build feedback into the loop. Developers come and go in an
Open Source development process and you need to build in regression
tests so that when new developers with new ideas come along, they
don't break code, or quickly realize what they have done after they
have run basic regression tests.

I also think that PHP developers are doing a fine job, but I don't think
there is anything wrong in pointing out where they can improve, rather
than apologize wholesale.

Regards, John

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

We will agree to disagree. I've experienced many testers who thought things
that you think. They were often the most cocky and least effective of the
hundreds I've worked with on projects, and again every product I've worked
with from Microsoft to Oracle to Java have had similar issues arise. I think
the PHP developers are doing a fine job, even if I do have to skip a
release, I've got my money on this being fixed in the next release.

<>< Ryan

-Original Message-
From: John Lim [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 2:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] ODBC problem in 4.2.0


Hi Ryan,

It's not true that this can happen to any product. PHP is a fantastic
language, but
there are well-known ways to manage QA. All it needs is to include ODBC
in the standard php regression test suite (and run the suite regularly!)

Regards, John

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
BTW... I'd just like to point out that this kind of thing is bound to happen
no matter what product you use. I'm certain the PHP guys will have this
solved in no time and I'd bet even they would recommend a commercial hosting
service be willing and able to step back if a problem like this occurs. This
is, however, just an opinion.

-Original Message-
From: Ryan Jameson (USA)
Sent: Monday, April 29, 2002 8:14 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] ODBC problem in 4.2.0



I'd recommend finding a hosting service that would be more careful about
making upgrades. There seems to be some problems with ODBC in 4.2 and I have
yet to hear of a work around, especially not one you can implement if you
don't handle your own server. I feel your pain man! Fortunately for me I can
just stay at 4.1.1 until there's a release that works.

<>< Ryan


-Original Message-
From: Mihai Tache [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 7:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] ODBC problem in 4.2.0


i work on a website that runs on php with MSSQL through ODBC.
until 4.2.0 everything was ok. but my hosting provider just upgraded to
4.2.0
the error message i get is :

SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with
results for another hstmt, SQL state S1000 in SQLExecDirect in 

take the folowing code for example :



the first odbc query runs OK but i get the error at the second one and ONLY
if the first one returned more than one row.
i even tried with 2 ODBC connections but doesn't work
MS has something to say about this at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032
don't know if that is really the problem or not. i don't know how i can set
ODBC (from php) to be synchronous anyway.
the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6
(both on win32).
i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said
is there something i can do except wait for 4.2.1 ?




--
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] ODBC problem in 4.2.0

2002-04-30 Thread John Lim

Hi Ryan,

It's not true that this can happen to any product. PHP is a fantastic
language, but
there are well-known ways to manage QA. All it needs is to include ODBC
in the standard php regression test suite (and run the suite regularly!)

Regards, John

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
BTW... I'd just like to point out that this kind of thing is bound to happen
no matter what product you use. I'm certain the PHP guys will have this
solved in no time and I'd bet even they would recommend a commercial hosting
service be willing and able to step back if a problem like this occurs. This
is, however, just an opinion.

-Original Message-
From: Ryan Jameson (USA)
Sent: Monday, April 29, 2002 8:14 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] ODBC problem in 4.2.0



I'd recommend finding a hosting service that would be more careful about
making upgrades. There seems to be some problems with ODBC in 4.2 and I have
yet to hear of a work around, especially not one you can implement if you
don't handle your own server. I feel your pain man! Fortunately for me I can
just stay at 4.1.1 until there's a release that works.

<>< Ryan


-Original Message-
From: Mihai Tache [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 7:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] ODBC problem in 4.2.0


i work on a website that runs on php with MSSQL through ODBC.
until 4.2.0 everything was ok. but my hosting provider just upgraded to
4.2.0
the error message i get is :

SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with
results for another hstmt, SQL state S1000 in SQLExecDirect in 

take the folowing code for example :



the first odbc query runs OK but i get the error at the second one and ONLY
if the first one returned more than one row.
i even tried with 2 ODBC connections but doesn't work
MS has something to say about this at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032
don't know if that is really the problem or not. i don't know how i can set
ODBC (from php) to be synchronous anyway.
the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6
(both on win32).
i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said
is there something i can do except wait for 4.2.1 ?




--
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] Re: [PHP-WIN] Update 4.1.2 > 4.2 : MSSQL Error S1000 (Parallel Requests)

2002-04-23 Thread John Lim

I am having problems too.

My ADOdb regression tests for msaccess/odbc and vfp/odbc fail every time.

No data is being retrieved :-(

Uggh.


"Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
>
> "Lars Schwarz" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]...
> | this has nothing to do with the odbc driver i think, because i already
> tried
> | different mdac versions, without success. it's simply like this:
> | switching between the two php version (without touching the mdac, odbc,
> | sqlsrv32.dll or anything) 4.1.2 works, 4.2 doesnt, so it must be the
odbc
> | implementation within php 4.2 
>
> I also think so. I'm getting some strange odbc errors (missing resultsets
> etc.) with 4.2.0, same query is working perfectly in 4.1.2. Some queries
> work perfectly as before, some don't. Until now i didn't find any pattern.
>
> I'll try to set up some test scripts, but i don't have any experience in
> doing that, so, if somebody could help me i wouldn't refuse.
>
> Christoph
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: PHP with DB2 and Oracle

2002-04-23 Thread John Lim

Yes, you create two independant connections to db2 (using odbc) and
another using oci8.

Regards, John

"Luis Silva" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all
>
> I am a beginner with PHP, so sorry if my question is to much basic for
you.
>
>
> Is possible to use PHP with support at same time for DB2 and Oracle ?
>
>  I mean can I use PHP to open two connections to  different database
> servers (Oracle and DB2) at same time ?
>
> Tanks on advance.
>
>
> Luis Silva
> IBM Data Management Solutions - Portugal
> Tel: +351 217915398
> External e-mail: [EMAIL PROTECTED]
> Web site: http://www.ibm.com/software/data/informix
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: OCIRowCount for a BEGIN...END block

2002-04-17 Thread John Lim

Hi Pedro,

There is the PL/SQL SQL%ROWCOUNT variable. Bind a PHP variable to it.


"Pedro Garre" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Hi,
>
> OCIRowCount does not seem to work when "inserts" are made in a block:
> BEGIN insert ...; insert ...; insert ...; END;
>
> It returns 1, but 3 rows have actually been inserted.
>
> How can I get the correct number of rows inserted ?
>
> Thanks.
>
> Pedro.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-17 Thread John Lim

Hi Manuel,

"Manuel Lemos" <[EMAIL PROTECTED]> wrote
>
> Most of the popular database abstraction packages support prepared
> queries, except for your PHP ADODb. So, think about this before you keep
> throwing sand to the eyes of the users that do not know better, may be
> you understand the point of catching up on what everybody else is doing
> for a long time.

If you read the ADOdb source, you would know it is untrue. We support
prepared queries, and emulate them if the database does not support it.

> The reason for this is that you had the dumb idea to spam all the lists
> you could remember with the forged claim that ADODB was faster than
> every other database abstraction because your convinient benchmarks
> showed that.

Tomas Cox rewrote PEAR DB after the benchmarks were published to speed
it up. We even worked together to improve bits of PEAR DB. You just moan
about how unfair the benchmarks are.

>
> Since your database abstraction could not beat others on real
> abstraction features you used that to drag users to your package to push
> them the commercial tool that you sell and requires ADODB to run.
>

Visit http://php.weblogs.com/adodb-cool-applications for a long list of
applications using adodb with multiple databases. None of the apps
except the first link use our commercial product, phpLens.

 I think that pretty much refutes your statement.

> That was the lowest Microsoft-like marketing trick - trap them into your
> Windows clone database abstraction "OS" to sell them your tool for which
> you have no competitor because nobody else is doing anything like that
> for your own abstraction later.
>

I interviewed to work at microsoft in 1989, but as a techie, i would have
made microsoft bankrupt if they had let me run their marketing for them :-)

> Of course you may claim ADODB is faster than any other abstraction
> package, but that's because it does not abstract data type conversion to
> make user applications portable.
>

Actually it does, but only for dates, because I find that most other types
can be easily handled because PHP is a very good language. Char and
varchar and numbers map easily to string and float/integer, and so forth.

I have told you this before.

> It is the same as stating that driving a motocycle naked and without
> helmet you will drive faster than clothed with the helmet on. It is not
> the same thing, but unfortunately for the victim users that have fallen
> for your argument they did not notice that your abstraction can only be
> faster by doing less, meaning providing less portability support.
>

Of course. Unneeded portability that is not used by most users
is of no interest to me. You disagree. That is fine. The code is there
for people to read. Let them judge for themselves.

> John, as a marketeer you still have a lot to learn before you realize
> that you can't fool everybody!
>
> Next you will release ADODB XP the one that makes hidden connections to
> your site to track what the users are doing! hehehe :-)
>
> Don't worry, nobody will sue you for the abusing the monopoly of
> applications for your PHP ADO DB! :-)
>
> Manuel Lemos

Manuel, you might not believe me, but what you are saying will make people
shy away from working with you in the future. Treating people with respect
is more
productive. I don't really want to spend my time defending myself when I can
be doing something else.

So I leave this thread to you and to you alone. The floor is yours.
Keep it clean.

John



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-17 Thread John Lim


Manuel,

> Prepared queries in practice are the same as what John Lim calls in this
> document http://php.weblogs.com/portable_sql as "binding", except that
> he doesn't seem to be aware that it is the same thing, so he says that
> only some database can use it! :-) Metabase handles prepared queries
> with ALL supported databases.
>
Some databases such as MS Access/MySQL do not support binding. So
even if you support MySQL, you only get emulated binding in MySQL, and
not the performance increase you might have expected. I hope that is
clearer.

> Last but not least, PHP ADODB is an attempt of John Lim to develop
> something of his own copying ideas and names from everywhere and cash on
> it by selling PHPLens. He copied Microsoft ADODB to appeal better to
> Windows users. But since ADODB was not meant specifically for portable
> Web development, he still needed to copy features of Metabase like
> auto-incremented integer sequence values and limiting the range of rows
> returned in select queries result sets. Some of these things that were
> copied had their names changes to not look so obvious but they are still
> copies of Metabase features because only Metabase provided them before.
>

Manuel,  you have a habit of saying nasty things, and you set a bad example
by
doing so, because you are a good programmer who should be a leader in the
community.

 I wish i were smart enough  to have copied from you, but unfortunately I am
too old and stupid. Most of the techniques you mention i learnt before i
even knew PHP,
let alone before had the pleasure of knowing you :-)

Instead I learnt from people who have built some of the finest database
technology around-
the MySQL people who developed the limiting range of rows with SELECT LIMIT
(that is why the function is called SelectLimit in honor of them), and
auto-incrementing stuff from
the Sybase/MS SQL Server designers. I cannot resist mentioning a forgotten
database abstraction
system which I learnt a lot from, developed by Apple, called DAL. A
fantastic product
that is sadly gone, but not forgotten.

I have no problems saying that I developed ADOdb because I needed a database
class library to implement phpLens. The reason is simple, there is no other
database
class library for php that had sufficient functionality to meet the
sophisticated data
requirements that I had. Frankly I would have used Metabase or PEAR DB or
something
similar if it was mature enough. As to the deficiencies of Metabase and PEAR
DB, i don't
think a mud-slinging match is appropriate, but I believe in my work, and
think it stands
very well compared to other libraries.

Yours sincerely, John

ps: ADOdb is released under a BSD-style license, there are no restrictions
to its use.

http://php.weblogs.com/ADOdb



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: LOBS with CURSOR_SHARING=FORCE gives core dump

2002-04-15 Thread John Lim

According to Thies, this is an Oracle bug. A quick workaround which I just
tested is to execute an alter session before updating the LOB, and restore
cursor_sharing=force after the update.

ALTER SESSION SET cursor_sharing=exact

Bye, John

"Prince" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> John!
>
> Thanks for the update. Did you find any work-around for this issue?
>
> Thanks,
> Prince.
>
> "John Lim" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hmm, I have also been having similar problems with LOBs. However it
might
> > not
> > be cursor_sharing=force, because on my Win 2000 oracle, LOBs work fine
> with
> > PHP
> > with this parameter set.
> >
> > However on our Sun server, PHP crashes as you mention (yes
> > cursor_sharing=force is
> > set here too).
> >
> > PS: this is set in init.ora.
> >
> >
> >
> >
> > "Prince" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I have the following php code. If I add the parameter
> CURSOR_SHARING=FORCE
> > >
> > > in my init.ora and while executing the program I get the "Segmentation
> > > fault".
> > >
> > > $ /usr/local/php4/bin/php -q curshare.php
> > >
> > > Segmentation fault (core dumped)
> > >
> > > Is there any work-around for this? Is this a bug? This seems to be
> > happening
> > > only when LOB with returning clause is present.
> > >
> > > I tested a similar program from "C" program and is fine.
> > >
> > > Note: currently I have set the parameter  (CURSOR_SHARING=FORCE ) only
> in
> > > the program/session level.
> > >
> > > Thanks,
> > >
> > > Prince.
> > >
> > >
> > >
> > >
> > >
> > > $ cat curshare.php
> > >
> > > #!/usr/local/php4/bin/php -q
> > >
> > >  > >
> > > //program name curshare.php
> > >
> > > $conn = OCILogon($dbuser, $dbpass, $dbname);
> > >
> > > //This is added to affect only the current session.
> > >
> > > $sql = "alter session set cursor_sharing=force";
> > >
> > > $stmt = ociparse($conn,$sql);
> > >
> > > OCIExecute($stmt,OCI_DEFAULT);
> > >
> > > $lob = OCINewDescriptor($conn, OCI_D_LOB);
> > >
> > > $sqlstmt = "insert into blob_test ( packageid, packagebody )
> > > values('12344321123efd', EMPTY_BLOB()) returning packagebody into
> > > :packagebody";
> > >
> > > $stmt = OCIParse($conn, $sqlstmt) ;
> > >
> > > OCIBindByName($stmt, ':packagebody', &$lob, -1, OCI_B_BLOB);
> > >
> > > OCIExecute($stmt, OCI_DEFAULT);
> > >
> > > OCICommit($conn);
> > >
> > > OCIFreeDesc($lob);
> > >
> > > OCIFreeStatement($stmt);
> > >
> > > OCILogoff($conn);
> > >
> > > ?>
> > >
> > >
> > >
> >
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: how connect a remote data base MSAccess with PHP in Linux system

2002-04-14 Thread John Lim

Hello Silvia,

Try using the database abstraction library ADOdb. It supports installing
a stub server (written in PHP) on the Windows server, and you can send sql
queries from
Linux to the Windows machine via http.

This is a 100% php solution. See http://php.weblogs.com/adodb_csv

"Silvia Mahiques" <[EMAIL PROTECTED]> wrote in message
002801c1e066$acf41d50$1a9cd29b@tscpc6">news:002801c1e066$acf41d50$1a9cd29b@tscpc6...
Hi friend!
I have a question...
I have a remote database in Microsoft Access on a WinNT System, and a Apache
and PHP on Linux System. How can I connect this?

There is one function in PHP for make this:

odbc_connect(DSN,user,password)

The question is:  what is DSN in my case? How I can to specified the host
and path where is situate the data base?

DSN (Data Source Name) in local host is the name of the DataBase, but in
remote host, what I need do?

Thanks in advance.


Silvia Mahiques



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: LOBS with CURSOR_SHARING=FORCE gives core dump

2002-04-11 Thread John Lim

Hmm, I have also been having similar problems with LOBs. However it might
not
be cursor_sharing=force, because on my Win 2000 oracle, LOBs work fine with
PHP
with this parameter set.

However on our Sun server, PHP crashes as you mention (yes
cursor_sharing=force is
set here too).

PS: this is set in init.ora.




"Prince" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have the following php code. If I add the parameter CURSOR_SHARING=FORCE
>
> in my init.ora and while executing the program I get the "Segmentation
> fault".
>
> $ /usr/local/php4/bin/php -q curshare.php
>
> Segmentation fault (core dumped)
>
> Is there any work-around for this? Is this a bug? This seems to be
happening
> only when LOB with returning clause is present.
>
> I tested a similar program from "C" program and is fine.
>
> Note: currently I have set the parameter  (CURSOR_SHARING=FORCE ) only in
> the program/session level.
>
> Thanks,
>
> Prince.
>
>
>
>
>
> $ cat curshare.php
>
> #!/usr/local/php4/bin/php -q
>
> 
> //program name curshare.php
>
> $conn = OCILogon($dbuser, $dbpass, $dbname);
>
> //This is added to affect only the current session.
>
> $sql = "alter session set cursor_sharing=force";
>
> $stmt = ociparse($conn,$sql);
>
> OCIExecute($stmt,OCI_DEFAULT);
>
> $lob = OCINewDescriptor($conn, OCI_D_LOB);
>
> $sqlstmt = "insert into blob_test ( packageid, packagebody )
> values('12344321123efd', EMPTY_BLOB()) returning packagebody into
> :packagebody";
>
> $stmt = OCIParse($conn, $sqlstmt) ;
>
> OCIBindByName($stmt, ':packagebody', &$lob, -1, OCI_B_BLOB);
>
> OCIExecute($stmt, OCI_DEFAULT);
>
> OCICommit($conn);
>
> OCIFreeDesc($lob);
>
> OCIFreeStatement($stmt);
>
> OCILogoff($conn);
>
> ?>
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: odbc vs mysql

2002-04-03 Thread John Lim

Try odbc connection pooling. That should help.

"Maris Kalnins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> When connecting to database (Sybase) through ODBC it takes some time to
> establish odbc connection with:
>
> $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);
>
> And only after that I am able to access data through SQL Selects
>
> The problem is that every time the script is finished this connection is
> automatically closed,
> how to keep it open after displaying a page - no idea ...
>
> How about using MySql in this situation?
> There will be no need to waste time connecting to ODBC every time,
> is it really so? could this be faster?
>
> is there any idea how to keep ODBC connections open after script is
> finished?
>
> Any other solutions?
>
> Thanks
>
> P.S. I tried to use Sybase funcitons.. but it says - that they're not
> defined or something like that..
>
>
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: to ora_bind or not to ora_bind

2002-04-03 Thread John Lim

Don't forget to quote the strings and run addslashes.

"Christian Schneider" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> sorry to post just after subscribing but I didn't find anything in the
faqs.
>
> I have to port an Oracle-based system to MySQL and am now investigating
> how to get rid of the Oracle specialities. I neither wrote the system
> nor do I fully understand how it's working yet, so I might miss something.
>
> The biggest trouble spot seems to be the use of the ora_bind functions
> as in the following example:
>
> $e = db_parse ($curs, "insert into usercomments values
> "."(:pkey,:pser,:pnam,:pema,:pdat,:ptxt,:psub,:pref) ")
>
> if ( ! $e ):
>$err = "Error in insert statement!";
>$errn = $curs;
> else:
>db_bind ($curs, "param_key", ":pkey", 6, 1);
>db_bind ($curs, "param_ser", ":pser", 16, 1);
>db_bind ($curs, "param_nam", ":pnam", 128, 1);
>db_bind ($curs, "param_ema", ":pema", 128, 1);
>db_bind ($curs, "param_dat", ":pdat", 64, 1);
>db_bind ($curs, "param_txt", ":ptxt", 1024, 1);
>db_bind ($curs, "param_sub", ":psub", 128, 1);
>db_bind ($curs, "param_ref", ":pref", 16, 1);
>if (!db_exec ($curs)):
>   $err = "Could not execute insert statement, sorry!";
>   $errn = $curs;
>else:
>endif;
> endif;
>
> The problem is that I don't really see what the use of the ora_bind is
> here. Is there anything that would forbid the port to:
>
> mysql_query("insert into usercomments values( $param_key, $param_ser,
> ..., $param_ref)");
>
> Or am I missing something substantial here?
>
>
> Thanks a lot,
>
> Christian
> --
> Christian Schneider <[EMAIL PROTECTED]>
>
> Zentrum für Angewandte Informatik --.. .- .. -.-
> Universitätsweiter Service .-. .-. --.. -.-
>
> + Universität zu Köln + Robert-Koch-Str. 10 + D-50931 Köln
> + Tel. +49 221 478 7021 +
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: major performance disparities with mysql/php

2002-03-21 Thread John Lim

Hi Henry.
I have a suggestion.

Run in a seperate window "top d 1" with php running or mysql client
and compare what happens. I presume that X-windows and similar mem/cpu
hogs are disabled.

Do post your results please. This should be interesting.

Regards, John


Henry Hank <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hello - I'm posted this to the mysql list but got no response.  While it
sounds
> like a mysql problem, I'm convinced that it is a PHP problem (see bottom
of
> note.)
>
>   I've recently installed mySQL on a RH7.2 box without any problems - it
runs
> great.  I've been testing some long running queries (full table scans,
etc)
> under different scenarios, and get wildy differing results.   Between each
test
> case, I was flushing all tables and re-starting the mysql deamon.  When I
run
> one of my longest queries in the mysql command line client, it runs in
about 77
> seconds.
>
> When I run the identical query via a simple PHP script running on the box,
the
> same query takes about 930 seconds to complete.  For the life of me, I can
not
> figure out why the identical query would run differently from the command
line
> than from PHP.  I've repeated this test about 10 times just to be sure -
and it
>
> is entirely repeatable: command line - about a minute - PHP - about 16
times
> longer.  Any ideas or suggestions?
>
>  I'm running RH 7.2 (2.4.9-21) on a Dell Poweredge 2550, 1GB memory, RAID,
with
> mysql version 3.23.41 (the standard install unchanged from the RH media).
Here
> is the query...pretty simple:
>
> insert into summary_table
>select frb, denom, series,
>count(*) as cnt,
>sum(bills) as bills,
>sum(bills_hit) as bills_hit,
>sum(total_hits) as total_hits
>from detail_table
>
> If it a memory/cpu resource problem, how do I set RH to give PHP and
Apache the
> same priority as the mysql deamon?
>
> I've also written a small Perl script to execute the same queries, and
that
> runs in 70 seconds (same as mysql client), so there must be some
> memory/processor limitation placed on PHP that prevents it from running as
> quickly as these other methods.  Any ideas/suggestions?
>
> Many thanks in advance..
>
>  -Hank
>
> __
> Do You Yahoo!?
> Yahoo! Sports - live college hoops coverage
> http://sports.yahoo.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Turtle slow bind variables are 6 times slower in Oracle?

2002-03-19 Thread John Lim

Found out why it was so slow.

>  $e = OCIExecute($stmt);

The above commits every insert. It should be changed to

>  $e = OCIExecute($stmt,OCT_DEFAULT);

Then I got the expected results. Using bind vars is nearly twice as fast.


"John Lim" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I recently benchmarked using bind variables for inserts versus sending
> simple sql over to oracle 8.1.7. Surprisingly, sending simple sql was
> nearly 6 times faster. My database is using cursor_sharing=force.
>
> Can anyone else verify this?
>
> >>>>>>> Not using bind variables (MySQL and Oracle), using ADOdb library:
>
> $DB->BeginTrans();
> for ($i=0; $i < $NUMRECS; $i++) {
>  $DB->Execute(
> "insert into test5000 (name,price,stock) values ('a name
> $i',$i,$i)");
> }
> $DB->CommitTrans();
>
>
> >>>>>>>>>> Using bind variables:
>
> $DB->BeginTrans();
> $a = '';
> $b = 0;
> $c = 0;
> $stmt = OCIParse($DB->_connectionID,
> "insert into test5000 (name,price,stock) values (:a,:b,:c)");
> OCIBindByName($stmt,":a",&$a,32);
> OCIBindByName($stmt,":b",&$b,32);
> OCIBindByName($stmt,":c",&$c,32);
> for ($i=0; $i < $NUMRECS; $i++) {
>  $a = "a name $i";
>  $b = $i;
>  $c = $i;
>  $e = OCIExecute($stmt);
>  if (!$e) {
>   print $DB->ErrorMsg();
>   break;
>  }
> }
> $DB->CommitTrans();
>
> ---
> For more details, see:
> http://php.weblogs.com/oracle_mysql_performance
>
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Turtle slow bind variables are 6 times slower in Oracle?

2002-03-15 Thread John Lim

Hello,
I recently benchmarked using bind variables for inserts versus sending
simple sql over to oracle 8.1.7. Surprisingly, sending simple sql was
nearly 6 times faster. My database is using cursor_sharing=force.

Can anyone else verify this?

>>> Not using bind variables (MySQL and Oracle), using ADOdb library:

$DB->BeginTrans();
for ($i=0; $i < $NUMRECS; $i++) {
 $DB->Execute(
"insert into test5000 (name,price,stock) values ('a name
$i',$i,$i)");
}
$DB->CommitTrans();


>> Using bind variables:

$DB->BeginTrans();
$a = '';
$b = 0;
$c = 0;
$stmt = OCIParse($DB->_connectionID,
"insert into test5000 (name,price,stock) values (:a,:b,:c)");
OCIBindByName($stmt,":a",&$a,32);
OCIBindByName($stmt,":b",&$b,32);
OCIBindByName($stmt,":c",&$c,32);
for ($i=0; $i < $NUMRECS; $i++) {
 $a = "a name $i";
 $b = $i;
 $c = $i;
 $e = OCIExecute($stmt);
 if (!$e) {
  print $DB->ErrorMsg();
  break;
 }
}
$DB->CommitTrans();

---
For more details, see:
http://php.weblogs.com/oracle_mysql_performance





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Is there a better way to do this?

2002-03-15 Thread John Lim


Leif K-Brooks <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I operate a small game site for kids.  On this site, the players  can,
among
> other things, buy virtual items.  I have each item stored in a table
called
> "items" in a mysql database.  The type is one column in that table, but it
> is a number, not a name.  When I want to display items with the item name,
I
> have to send a query to the item_types table to get the type name.  The
> problem is, if a user has 50 items, it takes 50 queries to get the types.
> Is there any better way?

Precache the item names in the items table, or use a join to get both item
numbers
and names in one query

select t.name, i.num from items i, item_types t
  where t.num = i.num and i.user=$userid



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Getting the ID of the last inserted record possible?

2002-02-23 Thread John Lim

What database are you talking about?

Andy <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> I would like to name pictures I uploaded after the belonging ID in the db.
>
> Is there a way to find out the ID of the last record. I thought it might
be
> a good idea to create the record, get the ID and copy the image with the
ID
> as name to the server.
>
> Can anybody give me a hint on that?
>
> Thanx Andy
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: PHP and big production database apps ?

2002-02-22 Thread John Lim

For a commercial PHP library for building applications, have a look at
phpLens at
http://phplens.com/ This was developed by our company, and we have used
it develop some pretty big applications (100 company extranet for example).

There are other libraries available, some free. I like to search
hotscripts.com
myself.

Regards, John


Pagin <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I am absolutly new to PHP and PostgreSQL. So far I developed production
> database apps for managing production in production comapny(using Clipper
> and DBF files). Now my boss has got idea to try using PHP and PostgreSQL
to
> create another production apps. These apps should run localy in company,
> collect all infos from production (time, quantity, persons, machines,
> production steps, parts, material and so on). Later these infos lets us
> build statistics, production plans, control people, calculate prices.
>
> And my general question is: can I develop complicated database apps for
> production company using PHP and PostgreSQL?
> How complicated screens can I build.?
> What about designing complex printings?
> Are there any additionall PHP libraries for building menus, screen
controls
> (buttons, radiobuttons, checkboxes, dropdownlists, window tabs and so on),
> designing printing reports, handling bar codes and handy scanners,
creating
> charts on screen, any other?
> what PHP language or PostgreSQL limitation can I face?
>
> Apps I developed so far has got about 25.000 code lines and uses about 100
> releted tables
>
> Thanks a lot for your replays.
>
> Wojtek
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Help on PHP vs JAVA

2002-02-21 Thread John Lim

Hi

Any consultant will tell you that all you need to do is define
the comparison criteria and you can choose the winner easily.

PHP: ease of use, low cost of ownership, etc.
Java: scalability, choice of implementations, etc.

I just hope you can live with your choices!

Regards, John

Berlina <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello to everybody,
>
> I need some help for writting a comparison of PHP vs JAVA, and of course,
I
> need that PHP wins
> ;-D
>
> Any ideas?
> Any comparison wrote?
>
> Advanced Thanks,
> F.P.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: Poisoned Persistent OCI8 Connections

2002-02-03 Thread John Lim

Hi,

I don't have a direct solution to the problem, but I would use Oracle's
Multi-Threaded Server and switch to using normal non-persistent PHP
connections. Eg. rely on Oracle to do the connection pooling instead
of PHP.

My benchmarks suggest that this is quite an efficient method of
connecting for short queries.

Regards, John

Hz11 <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have PHP 4.0.6 compiled as an Apache 1.3.20 module with OCI8 and MySQL
> on RedHat 6.2.  I use persistent connections with OCI8 to avoid the
> costly connection construction for Oracle for each request.  However, I
> notice that these persistent connections get "poisoned" under certain
> circumstances.  What I mean by this is this:
>
> Since each persistent connection stays with it's corresponding Apache
> process, if the database happens to be down when a request comes in, the
> persistent connection that is used throws an ORA-03113.  However, even
> when the database comes back, the persistent connection still thinks the
> database is down somehow, and will continue to throw the ORA-03113
> error.  As a result, if a request happens to hit the poisoned Apache
> process, it appears the database is down.  If a request hits another
> Apache process, all is OK.
>
> So far, the only way I've seen to deal this is to restart Apache, and
> have the persistent connections build up again.  Obviously, this is not
> a good thing, and if the database should go down again, the persistent
> connections get poisoned again, and the cycle begins.
>
> How can this be dealt with?  Any help would be great, as customers don't
> like having to refresh the page to avoid error messages.  If any more
> info or clarification is needed please contact me.
>
> Thank you,
>
> Hans
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Ensuring users don't overwrite each other (NOT a newbiequestion)

2002-02-02 Thread John Lim

Hi,

This is a technique I first saw in the O'Reilly book
"Oracle Design". The idea is to use integers rather than
dates, and treat the integers as semaphores (or latches in
Oracle terminology). This technique is very portable
as it does not require date types.

Create an integer column called LOCKCNT in the table.

When retrieving your record, remember the last value of LOCKCNT
in lastlockcnt.

When updating, use

UPDATE table SET col1 = ??, ..., LOCKCNT = LOCKCNT + 1
WHERE key = ??? and LOCKCNT = lastlockcnt;

If the record has been modified by someone else, the UPDATE will
fail.

Regards, John


Dl Neil <[EMAIL PROTECTED]> wrote in message
05cf01c1acaa$19f774b0$c200a8c0@jrbrown">news:05cf01c1acaa$19f774b0$c200a8c0@jrbrown...
> This is good brain-storming guys!
>
> > Better to use an integer rather than a date field as 2 simultaneous
> > transactions can still occur on the same second; most date time fields
> > are accurate only to the nearest second.
>
> Good point, John.
> However MySQL (AFAIK) does not have any time functions returning values
less than one second. So are you
> proposing to use PHP's microtime function? That being the case, the two
components (seconds and micro-secs)
> would have to be added together. Also the field would either have to be
changed to accept a floating-point
> value, or the combined number multiplied up to be integral microseconds
(of the Unix epoch).
>
> > > Are you guys interested in yet another solution?  It simular but I
think
> > > it's even easier if that's an incentive...
>
> =always interested in constructive suggestions - I've learned from this
conversation - as well as enjoying the
> challenge/getting the brain cells to all march around in the same
direction...
>
> > > -In your table do put a datetime field, I'll call it lastMod.  This
will
> > be
> > > the "last updated" date and time (you need time here)
> > > -In your form have this as a hidden field so it gets submitted with
the
> > rest
> > > of the data.
> > > -When you receive the data to update the record you have I presume the
> > > record ID in $id and the last modified date timein $lastMod.  Create a
new
> > > $now with today's date and the current time
> > > Your SQL will look like:
> > > UPDATE Foo
> > >  SET  col1 = $col1,
> > >   col2 = $col2,
> > >   col3 = $col3,
> > >lastMod = $now
> > >  WHERE recordID = $id
> > >AND lastMod = $lastMod
> > >
> > > As you can see the will succeed only if lastMod has not been changed.
And
> > > if it had been updated it will not fail (it's perfectly valid SQL) but
> > will
> > > not update any records.
> > > -Now to check if you did update the record...
> > >   SELECT lastMod
> > > FROM Foo
> > > WHERE recordID = $id
> > > And compare this to your $now value.
> > > Or in MS SQL you can check the @@rowcount variable - (that's a MS SQL
> > value)
> > > it will be 1 - success or 0 - collision (if it's > 1 you've got
duplicate
> > > ID's).
>
> =if using MySQL then MySQL_affected_rows() would be more efficient - no
call to the RDMBS.
>
> =Unfortunately if this database requires an additional SELECT, then the
solution requires a SELECT (to populate
> the form), and UPDATE (attempt), and a second SELECT to confirm the
UPDATE. This is exactly the same 'cost' as
> earlier suggestions. (ignoring the UPDATE-clash situation which will have
the same effect/cost in all cases)
>
> > > This has some disadvantage in that your end used could go through all
the
> > > effort to update a record only to have their update fail - I suggest
> > putting
> > > a nice error message and refresh the values in the form with the
current
> > > ones.
>
> =which is the accepted fate of all of these suggestions - and the
inevitable (if very occasional) impact of
> multi-user systems - always assuming that such a fact is of major interest
to the user!!!
>
> > > It has the advantage of avoiding locking, setting flags, rolling back,
you
> > > only need to compare one field and more work for you - and it will alw
ays
> > > work.
>
> =So given all of the questions above, I wondered why use an (extra) time
field at all?
>
> =I don't think that the original question mentioned how many fields were
being updated by the form interaction
> (please correct me if I'm wrong), but I think the outline above could be
applied reasonably effectively, even if
> several fields were being updated (and it MATTERED to the user if some
other user updated one or more,
> meantime).
>
> =Borrowing from Frank's code:
>
> UPDATE Foo
>   SET  col1 = $col1,
>   col2 = $col2,
>   col3 = $col3
>   WHERE recordID = $id
> AND col1 = $col1ValueFromSelect,
> AND col2 = $col2ValueFromSelect,
> AND col3 = $col3ValueFromSelect
>
> =This will complete without incident if the row has been untouched between
the initial SELECT and the UPDATE,
> and will fail if any UPDATE meantime has affected one of the pertinent
data fields. NB any UPDATE that does
> affect the subject-

Re: [PHP-DB] Ensuring users don't overwrite each other (NOT a newbiequestion)

2002-02-01 Thread John Lim

Hi

Better to use an integer rather than a date field as 2 simultaneous
transactions can still occur on the same second; most date time fields
are accurate only to the nearest second.

Regards, John

Frank Flynn <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Are you guys interested in yet another solution?  It simular but I think
> it's even easier if that's an incentive...
>
> -In your table do put a datetime field, I'll call it lastMod.  This will
be
> the "last updated" date and time (you need time here)
>
> -In your form have this as a hidden field so it gets submitted with the
rest
> of the data.
>
> -When you receive the data to update the record you have I presume the
> record ID in $id and the last modified date timein $lastMod.  Create a new
> $now with today's date and the current time
>
> Your SQL will look like:
>
> UPDATE Foo
>  SET  col1 = $col1,
>   col2 = $col2,
>   col3 = $col3,
>lastMod = $now
>  WHERE recordID = $id
>AND lastMod = $lastMod
>
> As you can see the will succeed only if lastMod has not been changed.  And
> if it had been updated it will not fail (it's perfectly valid SQL) but
will
> not update any records.
>
> -Now to check if you did update the record...
>
>   SELECT lastMod
> FROM Foo
> WHERE recordID = $id
>
> And compare this to your $now value.
>
> Or in MS SQL you can check the @@rowcount variable - (that's a MS SQL
value)
> it will be 1 - success or 0 - collision (if it's > 1 you've got duplicate
> ID's).
>
> This has some disadvantage in that your end used could go through all the
> effort to update a record only to have their update fail - I suggest
putting
> a nice error message and refresh the values in the form with the current
> ones.
>
> It has the advantage of avoiding locking, setting flags, rolling back, you
> only need to compare one field and more work for you - and it will always
> work.
>
> Good Luck,
> Frank
>
> On 2/1/02 12:42 PM, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
>
> > From: "Peter Lovatt" <[EMAIL PROTECTED]>
> > Date: Fri, 1 Feb 2002 08:09:56 -
> > To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> > Subject: RE: [PHP-DB] Ensuring users don't overwrite each other (NOT a
newbie
> > question)
> >
> >
> > Hi
> >
> > Interesting problem! Systems would be so much easier to build if we
didn't
> > have to allow for users :)
> >
> > Two suggestions, depending on how you want the data dealt with.
> >
> > A table of rows in use, with a time stamp and an owner. When user1 opens
the
> > record, stamp it with owner and time. If user2 wants to use the record,
> > check when it was 'locked' and apply a timeout based on how long it
takes to
> > edit. For example if the record was opened 3 mins ago, and the timeout
is 5,
> > the user2 gets a message saying 'Record in use try again in 2 minutes'
If it
> > was opened 6 minutes ago set the owner of the locked record to user2,
and
> > reset the timestamp.
> >
> > If / when user1 submits, refuse the update, and inform user1, and
whatever
> > handing you need after that.
> >
> > If no user2 has tried to open the record, then user1 can still submit,
> > because they still own it, even if there is a timeout.
> >
> > If you are feeling flash maybe a JavaScript timer that pops up 1 minute
> > before timeout and warns user1 to save (update record and reload for
more
> > editing)?
> >
> > Probably more hassle than its worth, but you could also take a snapshot
of
> > the data, when user1 starts, and if more than one user tries to edit the
> > record, save the updates in a temp table, compare the updated record
with
> > the original snapshot, and do some sort of intelligent amalgamation.
> >
> > HTH
> >
> > Peter
> >
> >
> >> -Original Message-
> >> From: Oliver Cronk [mailto:[EMAIL PROTECTED]]
> >> Sent: 31 January 2002 23:09
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP-DB] Ensuring users don't overwrite each other (NOT a
> >> newbie question)
> >>
> >>
> >>
> >> Hi there, currently writing an e-CRM system for an intranet using PHP
on
> >> Win32 and MS-SQL.  This system needs to be scalable but more
importantly
> >> there will be anything up to 400 users (unlikely, but the max
> >> amount) using
> >> the same records (updating information about customers etc) and I
> >> worry that
> >> whilst one user has a form open (via one of my PHP scripts) that
another
> >> user could also be making changes to the same record and if they post
it
> >> before the other one they could overwite each others changes.  For
info:
> >> database is normalised to 3NF so that side of things should be okay.
> >>
> >> I have thought of a couple of solutions:
> >>
> >> Row Locking when a user has a record - and if another user wants
> >> to use that
> >> record PHP tells them its in use.  But if the forst user doesn't make
any
> >> changes how will the db know to unlock the row and there might be
> >> potential
> >> deadlock issues.  Also I'm not sure of the SQL for row l

[PHP-DB] Re: session vars between two host servers

2002-01-31 Thread John Lim

Your solution sounds good. That's what I use too.

<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Problem: hosts "http://www."; and "https://secure."; of the same domain need
> to work with the same browser session_id.  This is a
> login/authenticate/redirect scenario.  In this case the session data store
> is a common MySQL database, so the issues of /tmp sharing, NFS, etc. are
set
> aside.  My platform is Apache 1.3.22 and RH Linux 7.1.
>
> What PHP v4.1.x method of exchanging the session_id and session_name is
most
> secure, most effective, and generally makes good soup?
>
> I've had some success with initial tests in appending
> '?PHPSESSID=29AE490...' to the URL and link hrefs, but that really seems
> ugly and unnecessary. hopefully there's a better way!?
>
> This question seems to get asked a lot in the archives but there doesn't
> seem to be a "guideline" resolution.
>
> PLEASE and THANK YOU!
> RF.
>
>
>
>
>



-- 
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] Re: :: Problems With Interbase :: Please Help ::

2001-12-14 Thread John Lim


Vins <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


> $database = "../../interbase_data/NAMES.GDB";

 Sorry, this is a relative path, not a full path.


> The php manual says that the $database variable must be the full path the
> database file if it's location is on the localhost.
> Now as you can see i've done that but i keep getting this dumb messages
> saying "Undefined Database".
> Please could any one help me.
> I have no clue what to do.
> I've been sitting for 2 days now and I've finally turned to the newsgroup.
> Please Please.
>
> Thanx
> Vins
> [EMAIL PROTECTED]
> Text Me: +27721807050
>
>



-- 
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] Re: Oracle database connection

2001-11-29 Thread John Lim

If you are using apache, you will have one for every Apache httpd process.
If IIS, then one per thread. Persistent connections are not per page, but
globally per process (provided the userid/passwords match).

<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> if I have the following in 10 seperate pages:
> OCIPLogon($User,$Pass,$DB_name);
>
> Do I have 10 seperate database connections, one for each page or do I
> have so other number of connections?
>
> Thanks.
>



-- 
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] Re: Table Locking...

2001-11-27 Thread John Lim

Hi Ashley,

Insert records into a table with a primary key that you define,
not an autoincrement field. When 2 people try to insert a record
with the same primary key, one will fail, the other will succeed.

The one that fails will poll the database until the other record
successfully completes the insert.

Regards, John

Ashley M. Kirchner <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> (PHP-DB folks, ignore this top question - unless you want to answer)
>
> Which type of DB/Table provides table locking while a process is
> altering data?  I don't care for locking while using SELECTs, but I do
> need locking when something's being INSERTed or UPDATEd, so I won't get
> two processes trying to do the same darned thing at the same time.
>
>
>
> (MySQL folks, ignore this bottom question - unless you want to
> answer)
>
> I'm somewhat lost on how to do the following:
>
> I'm trying to go through a table and check for a particular
> information.  If it doesn't exist, then go ahead and issue an INSERT
> with the relevant data.  The next time another process comes along,
> it'll obviously find the information and issue an UPDATE instead.  But,
> what happens if I get two processes running at the same time, trying to
> find information that does not exist yet?
>
> If both issue a SELECT and find the information not there, both will
> try to issue an INSERT, where really I want one of those processes to
> wait for the first one to finish doing whatever it needs to do, prior to
> continuing.  (all of this is being done in PHP by the way).  Does anyone
> have any suggestions for this scenario (or am I just blowing smoke out
> my arse and there's something else, internally, that I'm not aware of?)
> When (and how) to issue some sort of "wait" state for one process while
> the other's finishing what it needs to do, then restart the second
> process (which should re-check for existing information, and not blindly
> issue another INSERT right after the first one).
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
>   +
>   Ashley M. Kirchner    .   303.442.6410 x130
>   IT Director / SysAdmin / WebSmith . 800.441.3873 x130
>   Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
>   http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
>
>



-- 
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] Common DB Abstraction Layer: Re: [PEAR-DEV] Adoption of Metabase

2001-11-20 Thread John Lim


Tomas V.V.Cox <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Tuesday 20 November 2001 07:41, Manuel Lemos wrote:
>
> Hi Manuel,
>
> > I don't have the time or motivation to develop things for PEAR just
> > because it is funny to cooperate. I am no longer a college student so
> > I don't have plenty of free time to spare. What I do is because I
> > need the things for my job. If I am not selling what I do, I don't
> > have a problem with sharing. That is what I am doing with Metabase.
>
> That's the same here. At least me I'm here to develop stuff that I
> later use in my work, so indirectly you and me are making money with
> that as it helps our work to be more productive.
>
> > One thing is certain, I don't want to go where I am not wanted. If
> > there is no interest in integrating Metabase in PEAR, fine. If not, I
> > don't have a problem with that. From the silence of PEAR core
> > developers, I am afraid there isn't much hope from their side to
> > cooperate.  At least I made an honest attempt to cooperate.
>
> It will be very nice to have a unique abstraction layer where all of us
> contribute to. But in my opinion to impose MetaBase isn't they way to
> go. PHPLib, ADODB, PEAR DB all are good developments with their
> community and their developers, and trying to drop all of them with
> Metabase is a crazy idea.
>
> The only exit I see of the multi abstraction layers problems is trying
> to join all those communities and start a new development from the
> ground. The code is almost all written so only need to glue it to meet
> the specs of the new resultant layer. Then each team could provide
> their own wrappers to make things easy to their users. That's IMO a
> cooperative behaviour.
>
> Tomas V.V.Cox

Hi Tomas, Manuel, everyone,

I think that different programmers have different needs.
Metabase's goal is 100% DB portability. PEAR DB builds on the
PEAR classes to give a solid set of classes. ADODB is aimed
at converting the heathen ASP'ers to the "one true religion".
I also know of a PHP DBI class also from people who still need
the $perl~= /fix/;

Each designer has a different point of view, like Tomas has
written a really excellent oci8 "select limit" emulation, but looking
at the code, it's so complicated that i decided not to incorporate it
in ADODB because I value simplicity. I know Tomas' code works
in theory, and its really impressive that you even considered UNIONs,
Tomas, but I just like "simple" code that I can keep in my head.

I think some standardization in terms of API is good, but I don't
think most people care. Newcomers to programming will want to use
something easy and "standard" - is PEAR DB already the standard?
Windows programmers would want to use something familar. I already
have a prototype PEAR DB api wrapper for ADODB , and ADODB has
support for PEAR Error() also, but the people who like ADODB
generally are not that interested (at the moment).

> to join all those communities and start a new development from the
> ground. The code is almost all written so only need to glue it to meet
> the specs of the new resultant layer.

Actually the common code is already available: it is the
database extension API's. But most of the problems are
in the database extension APIs also, and our work is fixing
their mistakes.

Examples:
-Oracle ocifetchinto() returns OCI_ASSOC arrays in uppercase,
 when everyone else is using lowercase.

-Magic Quotes murders our quoting, and what about magic quotes
 sybase which happens to be for interbase and sql server too!

-Postgresql does not have an error number to return. And there is
 no pg_insert_id() either.

-Interbase's API is missing an arm and a leg, and whether it is
 the left or right arm missing is not documented anywhere.

-All extensions should support blobs like Oracle, with a fetch mode
 that makes "SELECT blob FROM table" transparent with no special
 coding.

If we fixed these problems and more, we could talk about having
a unified API. Otherwise for the Oracle OCI_ASSOC, I would prefer
not to change it for speed, Manuel would want to provide an emulation
layer, i would object because it's slow, etc...

 John

PS: the history of windows shows it's ok to have multiple abstraction
layers: ODBC, RDO, DAO, ADO, ADO+, JDBC, Delphi's db classes, VB's data
controls, provided there is progress.









-- 
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 and MS SQL 2000 Performance

2001-11-19 Thread John Lim

Are you using ODBC? We recently had similar problems, and it turned out that
we
had SQL tracing enabled, and every single ODBC function call was being
written
to SQL.LOG, slowing things down, so a simple query took 7 minutes.

Joshua Hoover <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I run SQL Server on my Pentium III 800mhz laptop which also runs IIS 5
> and a variety of other services (including the PHP cgi) and have not
> seen any type of performance problems.
>
> First, are you using the mssql.dll to connect or ODBC?
>
> Second, are you running PHP as a cgi or ISAPI plug-in?
>
> Third, is performance from an ODBC client and/or remote Query Analyzer
> client slow performing the same queries?
>
> Fourth, did you check your SQL Server box and look at the activity on
> it?  Is SQL Server or some other service hogging resources?
>
> Thanks,
>
> Joshua Hoover
>
> > We're only running one database on the system. The sample databases that
> > come with the software are still on there, but they're not being used at
> > all - this system is still in the testing stage.  We're running an
> > Athlon
> > 1.2 GHz processor with 512 MB RAM.
> >
> > "Gadam" <[EMAIL PROTECTED]> wrote in message
> > 001c01c170b4$266aeb50$0100a8c0@fintani">news:001c01c170b4$266aeb50$0100a8c0@fintani...
> > MS SQL has generally very slow performance and is consuming a lot of
> > system resources. Are you running any other databases on the SQL server,
> > apart from the one you are querying? Could it be that your system has
> > very small processing power? In any case, these possibilities wouldn't
> > justify suck a long delay, unless you SQL server is "overcrowded" with
> > other huge databases that you use...
> > George
> >
> >
> >
> > --
> > 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] Re: MS Access Error

2001-11-13 Thread John Lim

Check the file permissions on the .mdb file. Make sure it is readable by
everyone.

Bye, John

Paul Lalli <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I'm just beginning experimenting with MS Access and PHP. I found all the
> tutorials online that explain how to create a DSN for my existing Access
> database, and went through the procedure fine. The DSN I chose is
> "prototype" and the database does not have a username or password. I then
> created a very simple script:
>
> 
> 
> Access connection
> 
>  #Open a connection to an access database
> $connection = odbc_connect("prototype","","");
> if ($connection){
> echo "Connection established\n";
> } else {
> echo "Connection NOT established\n";
> }
> ?>
>
> When running this file, I get the following output:
>
> Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The
Microsoft
> Jet database engine cannot open the file '(unknown)'. It is already opened
> exclusively by another user, or you need permission to view its data., SQL
> state S1000 in SQLConnect in D:\www\Lalli\php\access.php on line 7
> Connection NOT established
>
> The server is running MS WinNT 4.0 SP6, with PHP 4.0. Can anyone help me
> out?
>
> Thank you,
> Paul Lalli
>
>



-- 
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] TREE in a database

2001-10-31 Thread John Lim

Actually relational databases are set-based.  The answer to
your tree structures question is that it is possible. It
is quite complicated though, so have a look at this phphoo
tutorial:

http://www.webreference.com/perl/xhoo/php1/


Rick Emery <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Relational databases really are tree structures.  However, whereas a tree
> parent node has pointers to children or sibling nodes; in a relational
> database, the nodes "point up" to the parent node.  The nodes might also
> maintain a field to identify sibling nodes.
>
> -Original Message-
> From: Robert Vukovic [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 29, 2001 2:03 PM
> To: 'Php-DB'
> Subject: [PHP-DB] TREE in a database
>
>
> Is there an easy way to implement tree structure in a database.
> Something like file systems do for files.
>
> Hints, links, anything.
>
>
> --
> 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] PhpLib, PEAR DB, Metabase, ADODB and Native MySQL benchmarks

2001-10-24 Thread John Lim

Someone asked me to benchmark PHPLib also.
Here is the revised benchmarks, with some minor speedups for
PEAR DB and Metabase.

Benchmark was to select 82 rows from the products table 200 times.
The tests were repeated 5 times. Connection times were excluded
from the benchmark. Lower values are better. All numbers are in
seconds.

MySQL  1.12 1.12 1.17 1.15 1.14
ADODB  1.43 1.47 1.47 1.44 1.45
PhpLib 1.53 1.62 1.64 1.64 1.57
PEAR   2.91 2.90 2.85 2.83 2.84 (fetchInto)
PEAR   3.14 3.13 3.22 3.12 3.16 (fetchRow)
M'base 4.51 4.55 4.46 4.54 4.52 (numeric columns)
M'base 4.99 4.72 4.71 4.71 4.72 (named columns)

  Average  Overhead
MySQL  1.14   -
ADODB  1.45   27%
PhpLib 1.60   40%
PEAR   2.87  152% (fetchInto)
PEAR   3.15  176% (fetchRow)
M'base 4.52  296% (numeric cols)
M'base 4.77  318% (named cols)

Methodology

Results on Pentium 800 Mhz running Win 2000, PHP 4.0.6 ISAPI on IIS5
with MySQL 3.23, all on the same machine. PEAR DB from PHP 4.0.6,
ADODB 1.40, PhpLib 7.2d and Metabase 1.57 were used.

Code revised on 22nd October 2001. PhpLib tests added 24th October 2001.

Source code for these tests is available from http://phplens.com/lens/adodb/









-- 
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] Re: ADORecordset Equivalent in PHP?

2001-10-24 Thread John Lim

Try http://php.weblogs.com/adodb

This is a database wrapper library which is very similar to M'soft ADO. Very
fast and full featured.

"Mrbaseball34" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I know about mysql_fetch_array but how would I do it for
> each row into a "recordset" that I can use instead?



-- 
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] Re: autoloading of session variables from mysql fields

2001-10-20 Thread John Lim

Hi Mike,

You will get better performance if you store the row as one session variable
(an associative array),
rather than one session variable per row element.

You can get the associative array using mysql_fetch_array($rs,MYSQL_ASSOC) i
believe.

Regards, John

<[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>  I am trying to write a function that will:
>
>  - take a list of mysql tables as an array ($sqltables)
>  - take a unique row identifier common to all tables ($rid)
>  - iterate through the $sqltables array and fetch the row for each table
> where rid = $rid
>  - discover the names of the fields in each table and do
> session_register for all of them
>  - set the value of each session_registered variable to the row contents
> for that $rid
>  - go to the next table and do it again, until all tables have been
> queried and all variables have been discovered and populated
>
>
>  I just need some help. Here is what I have written from the top of my
> head:
>
> Thanks in advance,
> Mike
>
> PS: please reply to my address personaly also!
>
> ---
>
>
> 
> function load_all($rid) {
>
> // this is a list of sql tables stored in an array that we will
> iterate through
> // and use to populate session variables
>
> include("/usr/local/apache/htdocs/survey/inc/sqltables.inc");
>
> for($Index=0;$Index
> // select the database for usage
>
> mysql_select_db($db2, $competency_link);
>
> // query the table for the row containing $rid
> $sql_query = mysql_query("SELECT * FROM $sqltables[$Index] WHERE
> rid = $rid");
> $result = mysql_query($sql_query);
>
> // fetch the row
> $myrow = msyql_fetch_array($result);
>
> // return the values of each fieldname as variables with same
> name
>
>
> // count the fields in the row
> $num_fields = mysql_num_fields($myrow);
>
> for($fieldindex=0;$index
> // return the field names
> $fieldname = mysql_field_name($num_fields[$fieldindex]);
>
> // return the values of each fieldname as variables with
> same name
> session_register('fieldname');
> }
> }
> }
>
> ?>



-- 
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] Comparing ADODB with PEAR DB, Metabase and Native MySQL

2001-10-19 Thread John Lim

PEAR DB, ADODB and Metabase are database abstraction libraries.
I decided to benchmark some of the most common database abstraction
libraries using a simple SELECT statement and measure the overhead
compared to using native mysql_* function calls:

Benchmark was to select 82 rows from the products table 200 times.
The tests were repeated 5 times. Connection times were excluded
from the benchmark. Values are in seconds.

MySQL  1.12 1.12 1.17 1.15 1.14
ADODB  1.43 1.47 1.47 1.44 1.45
PEAR   3.14 3.13 3.22 3.12 3.16
M'base 4.99 4.72 4.71 4.71 4.72

  Average  Overhead
MySQL   1.14 -
ADODB   1.4527%
PEAR 3.15   176%
M'base4.77   318%

I was still surprised at how slow some of the libraries were, even
though a code inspection had already given strong hints on the expected
performance of the class libraries.

Methodology

Results on Pentium 800 Mhz running Win 2000, PHP 4.0.6 ISAPI on IIS5
with MySQL 3.23, all on the same machine.

Source code for these tests is available from http://phplens.com/lens/adodb/





-- 
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] Re: importing BLOBs from MSSQL

2001-10-19 Thread John Lim

Switch to odbc. There are some limitations with mssql extension.

Regards, john

M0sh3 <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi, i'm trying to import tables containing TEXT fields from MSSQL 2K, so
far
> tried different ways, one of them DTS, but unsuccessfully.
>
> It gives error: "Query-based insertion or updating of BLOB values is not
> supported."
>
> Any help will be very much appreciated :)
>
> Moshe
>
>



-- 
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] Re: Speeding up database access

2001-10-05 Thread John Lim

Hi

Check your indices are tuned.

Personally, I feel that storing languages srings in arrays, particularly if
you are using a cache like Zend/APC gives better performance.

Bye, John

"Rob)" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am just starting out on a project that has to be multi-lingual. i.e.
> every word/sentence I output has to be translated.
>
> The user logs in, and I read the language they use, by looking at the
> user record.
>
> I then need to get the language translations from a database.
> I just "select label, text from language where lang = "English";
>
> Fields: [label],[text],[language]
> Example: "M1002","Please enter the delivery address","English"
>
> At the moment I download them into a associative array, so I can
> access the text like this.
>
> txt['M1002']
>
> where 'M1002' is a label. I have made txt a session variable.
>
> The trouble is, there are so many text translations (6000+), that it
> takes about 10 seconds to download them all into this array.
>
> I don't want to access the database every time I need to print out
> some text.
>
> Question:-
>
> How can I improve the startup time??  In case it was not obvious from
> the above, I am a newbie at PHP!!
>



-- 
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] Re: Interbase and php on win2k...

2001-10-05 Thread John Lim

Hi,

It definitely is not running the dll. Run



and check that the interbase extension is loaded. See if any other
extensions can be loaded  by modifying php.ini.  Check to see if you have
multiple php.ini's and check your file/directory permissions. Persistence is
the key.

Bye, John

- Original Message -
From: "Christian C." <[EMAIL PROTECTED]>
Newsgroups: php.db
To: <[EMAIL PROTECTED]>
Sent: Friday, October 05, 2001 6:33 PM
Subject: Interbase and php on win2k...


> Hello :c)
>
> I cant make this work together...
>
> I have set up php (it works)
> I have set up ib (it works)
> but when i try to query ib using php i get :
>
> Fatal error: Call to undefined function: ibase_connect() in
> c:\inetpub\wwwroot\ib.php on line 10
>
> I have set my extension_dir to (where the dll reside)
> extension_dir = C:\Servers\PHP\extensions
>
> and uncomment my dll:
> extension=php_interbase.dll
>
> Any one know what the broblem could be???
>
> Thanks
> Christian
>
>



-- 
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] Performance boosting

2001-10-03 Thread John Lim

You need to break up your web page into several independant html tables, not
nested tables. Each independant table will be rendered progressively as it
downloads. That's the effect you are seeing.
-John

"Ricky Theil" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> There is a certain amount of the script that the browser can display
before
> the script is done loading.  I'm not sure exactly how much that is, but
I've
> seen this before.  I wrote a script that pulls info out of a mssql DB, and
> it shows the top part of my script while pulling DB info.  It's because I
> display a ton of stuff before the query is performed.
>
> If there's not enough stuff before the query is executed, it doesn't show
> anything.  If there's too much, it shows up to a certain point.
>
> Ricky
>
> -Original Message-
> From: Luditus [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 03, 2001 2:27 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Performance boosting
>
>
> Hi there,
>
> my phpsite shows always a white page while accessing the db. Sometimes for
> seconds. How can I change it to a style like for example php.net does.
While
> it is searching the db it shows the php logo and the header of the html
> site. It looks like that: http:www.globosapiens.net/gallery
>
> Cheers 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

2001-10-02 Thread John Lim

Hi Mark,

Thanks for the investigation! Will add your comment to the db2 drivers of
adodb.

Regards, John


"Mark Newnham" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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] Re: PHP and MS Access

2001-10-02 Thread John Lim

You shouldn't need to install MySQL to use MS Access. Seems like they are
giving you excuses to avoid any extra work on their part. I would suggest
you switch web-hosting companies if they are behaving this way.

Hostpro.com is one that supports PHP and Access.

PS: I am not affiliated to hostpro in any way accept as a satisfied
customer.

Regards, John

"Djgray" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I apologize if this is a redundant post. I did do a search and could not
> find the answer.
>
> I'm swimming in ignorance as I build a website for a friend. The hosting
> service says they support MS Access and PHP. However, they are telling me
> that in order for PHP to get to that database, I would also need MySQL,
> which they do not have and have no plans to install.
>
> Is this accrate?
>
> Can PHP not get to the Access database directly?
>
>



-- 
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] Re: PHP vs. 2 database softwares

2001-10-01 Thread John Lim

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-DB] oci8.max_links missing from php.ini

2001-09-29 Thread John Lim

Hello,

I checked the windows php.ini and i did not see any reference to

oci8.allow_persistent=On ; allow or prevent persistent links
oci8.check_persistent=On ; check that a connection is still validbefore
reuse
oci8.max_persistent=-1 ; maximum number of persistent links. -1 means no
limit
oci8.max_links=-1 ; maximum number of links (persistent+non persistent). -1
means no limit


Are they actually supported?

Thanks, John





-- 
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] Re: CASE tool

2001-09-22 Thread John Lim

I have heard that Dezign is popular with mysql. I have downloaded it but I
never used it as the oracle support was not adequete for my needs.

http://www.datanamic.com/dezign/

"Adv. Systems Design" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi:
>
> Anyone offer recommendations for a CASE/E-R
> modeling/Data dictionary tool that can be used with
> MySQL?
>
> Thanks
>
> Luis
>
> __
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger. http://im.yahoo.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]




[PHP-DB] Re: MSSQL question

2001-09-21 Thread John Lim

Just install php and enable in your php.ini file the line

extension=php_mssql.dll

And make sure this dll is in your php extension folder.

Regards, John

"Sharif Islam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I already have a MSSQL 7 installed in win2k with IIS. I want to install
> php. Do i need to configure anything with mssql?
> thanks
>
>
> )
>((
>   |""|-.
>   | :|/'
>  -`--'-
>



-- 
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] Re: PHP and Fox Pro (ADODB) question

2001-09-05 Thread John Lim

Best is to port the database to mysql then.

Regards, John

"Er GalvãO Abbott" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is it possible to do it on Linux servers?
>
>
>
> On Wed, 5 Sep 2001 23:39:09 +0800, [EMAIL PROTECTED] (John Lim)
> wrote:
>
> >Hello,
> >
> >You need to configure an ODBC DSN that accesses the foxpro database.
Assume
> >the DSN is called foxy.
> >
> >Then download from http://php.weblogs.com/adodb the library.
> >
> >Sample code:
> >  include('adodb.inc.php'); include('tohtml.inc.php');
> >  $conn = &ADONewConnection('vfp');
> >  $conn->PConnect('foxy');
> >  $rs = $conn->Execute('select * from table');
> >  rs2html($rs); /* recordset to html table */
> >John Lim
> >PS: This only works on Windows.
> >
> >
> >
> >"Er GalvãO Abbott" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Greetings
> >>
> >> I'm a newbie but I've been doing very nice thing with PHP. Now a
> >> challenge appeared and I'm kinda lost and in need of some help.
> >>
> >> I have a project that I have to make search and display routines in a
> >> Fox Pro database. Everything was wonderful because almost all data
> >> I've needed was stored in DBF files and PHP Dbase functions were
> >> handling this very well.
> >>
> >> Now I've found that a piece of data that is extremely important to the
> >> application is in a FPT file. I saw a thread here that recommends the
> >> use of the ADODB library for PHP that can be found at
> >> http://php.weblogs.com/ADODB
> >>
> >> Well, what I need, hoping that I'm not asking too much is if there is
> >> anyone hre that can give me a practical example - maybe a code snip -
> >> on how to achieve this.
> >>
> >> Any help will be gratefully appreciated.
> >>
> >> Thanks in advance,
> >
> >
>



-- 
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] Re: insert problem mysql

2001-09-05 Thread John Lim

Use

$s = addslashes($s);


"Shi" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
> I'm trying to insert a text into a MYSQL DB, and here is the problem. If
the
> text looks like this "x xx x x xxx 'xxx xxx" then PHP interprets the
> text following the ' as an sql statement. Does anyone know how to overcome
> this problem.
>
> Thank you
> Shimon
>
>



-- 
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] Re: PHP and Fox Pro (ADODB) question

2001-09-05 Thread John Lim

Hello,

You need to configure an ODBC DSN that accesses the foxpro database. Assume
the DSN is called foxy.

Then download from http://php.weblogs.com/adodb the library.

Sample code:
  include('adodb.inc.php'); include('tohtml.inc.php');
  $conn = &ADONewConnection('vfp');
  $conn->PConnect('foxy');
  $rs = $conn->Execute('select * from table');
  rs2html($rs); /* recordset to html table */
John Lim
PS: This only works on Windows.



"Er GalvãO Abbott" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Greetings
>
> I'm a newbie but I've been doing very nice thing with PHP. Now a
> challenge appeared and I'm kinda lost and in need of some help.
>
> I have a project that I have to make search and display routines in a
> Fox Pro database. Everything was wonderful because almost all data
> I've needed was stored in DBF files and PHP Dbase functions were
> handling this very well.
>
> Now I've found that a piece of data that is extremely important to the
> application is in a FPT file. I saw a thread here that recommends the
> use of the ADODB library for PHP that can be found at
> http://php.weblogs.com/ADODB
>
> Well, what I need, hoping that I'm not asking too much is if there is
> anyone hre that can give me a practical example - maybe a code snip -
> on how to achieve this.
>
> Any help will be gratefully appreciated.
>
> Thanks in advance,



-- 
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] Re: Stored Procedure

2001-09-04 Thread John Lim



Change to:

$sth = OCIParse ($c, "begin CPF_ORA(=:cpf);end;" );
OCIBindByName ( $sth, ":cpf", 12);

There could be other bugs but I'm sure you can fix them.

> and I having this error message:
>
> Fatal error: Only variables can be passed by reference in c:\program
> files\apache group\apache\htdocs\testes\procedure5.php on line 10
>
> can aybody help me?
>
> thanks
>
> Bona
>
> __
> Visite http://www.trama.com.br
>



-- 
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] Re: MySql database data has html code in it

2001-09-02 Thread John Lim

Hi
Try echo htmlspecialchars($code) to display the html.


"Crosswalkcentral" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello
> Another question for the pros.
>
> I have a Mysql database which contains a table labled html
> in this table I have some short html scripts
> I have created a search for my scripts and when I Echo them (example code
> below) It only shows me the text and not the html script itself
>
> Echo ($code);
>
> Is their another function that I can use to display to contents of this
> variblae?
> I assueme that PHP is trying to process it as part of the echo statement.
>
> --
> Cross Walk Central
> www.crosswalkcentral.net
> Support Center
> Your Web Hosting Community!
>
>
>



-- 
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] Re: How can you hide database login passwd in your script?

2001-09-02 Thread John Lim

Hello Michael

That's why we use the Zend encoder for additional security. If that is out
of your budget, I suggest compiling the password into an extension.

Remember to unset all variables which contain passwords after they are used,
otherwise a print_r($GLOBALS); could reveal everything.

Regards, john

"Michael" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How can you hide database login passwd in your script?
>
> I hate having to have scripts with passwords in it that can be viewed by
> others.
>
>
>



-- 
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] Re: Database "Transactions" and HTTP statelessness

2001-08-30 Thread John Lim

There is no need to use transactions if you are dealing with 1 table.

Have a version column in the table which is numeric. When you first
select/edit the record, store the version number.

When you update, use:

update table set version = version + 1, data = ...  where key=$id and
version = $version

If the version number is different (eg. someone has updated the record)
affected_rows() will be zero.

This technique is sometimes called an optimistic locking strategy.

Regards, John


"Bopolissimus Platypus" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hello all,
>
> I've got a question about what's got to be a common problem.
> I'm sort of doing a survey to see how others have solved this
> problem before so that I can choose one that's best for me.
>
> Basics:
> The software is a web based data entry system.
> Sessions are maintained (so that users don't have to
>  login after every database operation, and for
>  security - users can only perform actions that
>  are allowed to their login or group0.
>
> Use Case:
> 0.   User A loads Record R.
> 1.   User B loads the same Record R.
> 2.   User B edits and saves Record R.
> 3.   User A edits and saves Record R.
>
> at this point, User B's changes are probably lost either
> in whole or in part.
>
> I can think of at least two or three ways to deal with this, but
> the two are ugly hacks that I'd rather avoid and the third risks
> running out of a vital and limited resource.
>
> The simplest solution I can think of would have the backend
> system start a transaction for A, at step 0.  the transaction
> would end at step 3.  User B would also try to start a
> transaction but since User A's transaction is still running,
> B would block until A ends it or rolls it back (since A is holding
> a lock).  for databases that don't have transactions, we would
> use record locking.
>
> The problem with this, of course, is that step 0 and step 3
> don't occur during the same HTTP request, so the transaction
> (or the locks) would have to be held/remembered between
> requests.  Further, the user need not actually save the record.
> he might just be viewing it.  After he's done, he might just
> close the browser.  So there would have to be a timeout
> so that locks would expire after a while.
>
> using SQL transactions as outlined above is messy but
> doable (there would be a middle-tier application layer that
> the PHP calls instead of calling database access functions
> directly).  i don't like it though because transactions are
> one per connection.  each possible database update
> would require a separate socket connection to the
> database.  and if our timeout is liberal (e.g., 30 minutes),
> then we're going to run out of sockets very quickly.
>
> i'd be very interested in hearing what others have
> done about this.  i've got other ideas that don't involve
> transactions, but i'm not going into those since they're
> too ugly to mention.  if i get desperate enough though,
> i may just ignore the ugliness and implement something
> just to get something working.
>
> tiger



-- 
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: Re: [PHP-DB] Error with in_use() from Beginning PHP4 book.

2001-08-26 Thread John Lim

See http://php.weblogs.com/adodb_csv

You create a proxy on Windows server and query access via the Windows
server.

"Vijay Anand" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

how to access MS Access database using adodb in unix








-- 
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] Connect to MySQL through Proxy?

2001-08-04 Thread John Lim

Hi,

The adodb database library has a wrapper to send queries using http.

See http://php.weblogs.com/adodb_csv

Regards, John

"Stephane Felix" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Or write a mysql-http pipe... that shouldn't be very hard
> write a php script that would echo all data on the source side, and a php
> script that would fopen the url of the source server, and put everything
> into the database.
>
> Stéphane
>
>



-- 
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] Converting MS Access to MySQL

2001-07-20 Thread John Lim

The best tool is MS Access. It has an export facility to ODBC data source.
Export to a MySQL odbc dsn.

Regards, John

"Taylor "Cody" Fletcher" <[EMAIL PROTECTED]> wrote in message
001401c11098$25cf98c0$[EMAIL PROTECTED]">news:001401c11098$25cf98c0$[EMAIL PROTECTED]...
> yeah, cut and paste, jk, im curious too
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 19, 2001 2:15 PM
> Subject: [PHP-DB] Converting MS Access to MySQL
>
>
> > Can anyone suggest a good utility for converting database from MS Access
> to MySQL?
> > Thanks.
> >
> >
> > --
> > 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] Re: Interbase/PHP/Apache implimentation

2001-07-14 Thread John Lim

Hi Jordan
I have been trying to use interbase with the IIS sapi unsuccessfully (PHP
4.0.6). I suspect that it is not thread-safe as CGI works fine.
It really is up to someone who can debug the php_ibase.dll source to fix
this as it apparently not an apache specific problem.

Regards, john

"Jordan" <[EMAIL PROTECTED]> wrote in message
00fe01c10bc4$b6470dd0$0a01a8c0@cu">news:00fe01c10bc4$b6470dd0$0a01a8c0@cu...
> Okay...
> ..I have been trying (and failing) to get Interbase to work with PHP,
served up by Apache on a
> Win2K machine.  Through a lot of headache and the process of elimination,
I have succeeded in
> getting an SQL response from PHP, after eliminating any instructions for
Apache to load the PHP
> module - using only the CGI interface.
>
> So, if I understand things, my problem has been that I've been attempting
to get Interbase support
> from the PHP module for Apache, which won't work for one reason or
another.
> If true, this comes as great relief, because I was beating my head against
the wall trying to figure
> out where my php.ini file was misconfigured
>
> So my question is this:  Can DBMS support be enabled using the
extension=php_interbase.dll directive
> in the php.ini file (as opposed to MySQL, where support is built in) ONLY
while in CGI mode?  Will
> the distribution version of php4apache.dll not look at the php.ini file,
to enable Interbase
> support?
>
> If that is the case, is there anywhere one might find a version of the
php4apache.dll file which
> enables Interbase support?
> I will use CGI if I must, but my preference is to use the Apache
Module
>
> Thanks in advance,
>
> --Jordan
>



-- 
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: MySQL Database Locking - needed?

2001-07-11 Thread John Lim

Hi

You don't need a text file. Just store a version number for each table row
and increment
on every change. Check to see if the version number has incremented means
that the row
has been updated. This is called optimistic locking.

Regards, John

"Raquel Rice" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Tom Peck wrote:
> > >
> > >How about writing a text file that would be your "lock" file, rather
> > >than depending upon MySQL to do it for you?
> > >
> > >--
> > >Raquel
> >
> > So what you mean is:
> >
> > If someone clicks on a car to edit, a txt file is written (maybe called
the
> > carID.txt).  Then if someone else clicks on that car to edit it, it says
> > that it is already being edited by someone else because the txt file
> > exists?  So what happens if that person who clicked first closes his
> > browser before updating the car?  How can that text file be
automatically
> > erased?
> >
> > I think I'll just assume that this wont be a problem, and if someone
> > overwrites someone elses edit then too bad.. :-)
> >
> > Tom
>
> Why not check the date/time the file was created?  If an arbitrary
> amount of time has expired (2 minutes?  5 minutes?) then you create your
> own lock file as if the first wasn't there?
>
> --
> Raquel
> 
> He who has imagination without learning has wings and no feet.
>   --Anonymous



-- 
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] Re: Performance: why it take so long time?

2001-07-10 Thread John Lim

Don't flush or print/echo too often. This generates many fragmented tcp-ip
packets
(causing the behaviour you observe). The fastest method is probably
store the accumulated HTML data in a variable and print the variable every
100 rows or so.

Regards, John

"Soeren Nielsen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Stefano
>
> I don't know if this is what you are looking for.
> Take a look at the flush() function which should bring output faster to
> the browser.
>
> Hope it help
>
> Cheers
> Soeren
>
> - Original Message -
> From: "Stefano" <[EMAIL PROTECTED]>
> > The question is: there are some variable configuration in Apaches or
> some
> > tips to use in the PHP code for fastening the replay? (For exaple i
> faund
> > that in a PHP page that display a FORM, the displaing time is smaller
> if I
> > do some calculation in the code than if I don't use it)
>
>
>



-- 
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] Re: using ADODB db class

2001-07-10 Thread John Lim

Hi Mark,
You can access the column by index position instead, or use as column alias:

"select a.col col1, b.col col2 from a,b where a.key = b.key"

Then access using col1 and col2.

Bye, John

"Mark Newnham" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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]




Re: [PHP-DB] Limiting # of connections to remote Oracle

2001-05-22 Thread John Lim

Hi Larry,

See
http://marc.theaimsgroup.com/?l=php-dev&m=98193543028899&w=2

I would create a special web server listening at port 81 to perform Oracle
queries. Your main web servers call the port 81 server using
fopen("http://proxyserver:81/updatemail.php?params=...";); to update the
Oracle database.

There are also tools to help you create a proxy database web server at
http://php.weblogs.com/adodb_csv

Regards, John

PS: This is taken from a list of Tuning PHP and Apache tips at
http://php.weblogs.com/tuning_apache_unix

""Larry Osborn"" <[EMAIL PROTECTED]> wrote in message
9eemqc$s7q$[EMAIL PROTECTED]">news:9eemqc$s7q$[EMAIL PROTECTED]...
> Greetings all,
> We are having serious issues with PHP4.0.5 using OCI8 and Apache 1.3.17.
>
> We have 4 webservers that handle our various needs for oracle. Each server
> has its MaxSpareServers in the httpd.conf set to 100. So that turns out to
> be 400 connections to the Oracle database.  We are not using persistent
> connections, because that makes the problem worse.  Does anyone know of a
> way to limit the number of database connections without having to turn
away
> users by limiting the number of apache processes?
>
> We are using php+apache+oci8 to subscribe and unsubscribe people to our
> mailing list.  We have simple select and update queries using
non-persistent
> connections.  Im not too sure what other information I would need to
> provide, Im just a webdeveloper, not a sysadmin, so please bear that in
mind
> :)
>
> Thanks for any help you can give me.
>
> Larry Osborn
> Web Developer
> Napster, Inc.
>
>



-- 
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] adodb 1.10 released

2001-05-19 Thread John Lim

http://php.weblogs.com/adodb

Database wrapper library 1.10. Now supports cached recordsets.

Example below:

include('adodb.inc.php');
include('tohtml.inc.php');
$ADODB_CACHE_DIR = '/usr/local/adodbcache';
$conn = &ADONewConnection('oracle');/* Oracle 8, use 'oci8' */
$conn->PConnect('','scott','tiger');
$rs = $conn->CacheExecute(15,'select * from table');
rs2html($rs); /* recordset to html table */

The 15  in CacheExecute() indicates that the recordset will be cached
for 15 seconds. Subsequent calls with this SQL statement will use the
 cached results until the 15 seconds expires.








-- 
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-notepad

2001-05-19 Thread John Lim

Visit  http://php.weblogs.com/editors for a list of editors.

"Sharmad Naik" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Please tell me an editor for Linux




-- 
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] Performance of Stored Procedures ?

2001-05-14 Thread John Lim

Here's a guess on the speed difference.

It really depends on when the stored procedure is compiled.

When astored procedure is compiled, a query plan is created
based on the distribution of the data and the indices that were
available at that point in time.

So it is possible for a simple select statement to be faster than a
stored procedure if the stored procedure is using stale information.

The way you do your benchmarks can significantly affect the timings
also. Can you share your benchmarks with us?


Regards, John


Robert Boehrs <[EMAIL PROTECTED]> wrote in message
0AF1B047BDAAD4119C01000102B0367C05389E@UNITED01">news:0AF1B047BDAAD4119C01000102B0367C05389E@UNITED01...
> Hi,
>
> i've just made some simple test with oracle and stored procedures. I've
used
> a simple select-statement within the stored procedure and the same query
for
> a direct query within php.
> The direct query was about 50% faster. Is that normal? Will the stored
> procedures become faster with more complex queries?
>
> Any comments welcome
>
> Robert
>
> --
> 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] mysql --> Commercial DBs, When will I need to upgrade?

2001-04-22 Thread John Lim

Some people in the APC mailing list have said that mysql blows up at around
200-300 queries a second.

http://lists.communityconnect.com/pipermail/apc-cache/2001-April/000611.html

Phil Jackson <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Some good advice already given, and I quite agree.  MySQL is no
light-weight - comparable to MS SQLServer and Oracle in performance.  Also,
running the DB on a dedicated DB server may buy some performance.  If you
must check out SQLServer, then http://www.sqlteam.com is a good place to
start.  At work we are an ASP shop, and have used Access for some
lightweight apps, but the mandate now is to use IBM's DB2 UDB product - a
DB2 database server, also, a mainframe IBM OS-390 DB2 database.  Don't know
the price tag, but they are very robust databases, if a bit quirky getting
Microsoft stuff to talk to IBM stuff...
> You could connect via the ODBC functions of PHP.
> Also try looking at http://www.4guysfromrolla.com and
http://www.asptoday.com - not trying to sell ASP - just good and varied
resources with good articles about
> databases in general can be found there in addition to asp material...
>
> Phil J.
>
>
> Doug Schasteen wrote:
>
> > I've been programming PHP w/ mysql for almost 2 years now for my
company. We develop online testing and surveying software. We are currently
running operations for a few specific companies where maybe 20-30 tests will
be taken online per day (it requires pulling the test questions out of the
database in random order, and then putting all of their answers into the
database at the end of the test.) This is currently running on a shared
webserver using php3 and mysql. Recently we've been talking about some
projects that will require a lot more use. (Could be 100 people taking a
test at once or it could be 1000 people taking a test at once. We don't know
yet.)
> >
> > If anyone has had some experience with upgrading as your operations
grow, I'd appreciate if you could answer ANY of the following questions:
> >
> > 1. At what point will mysql blow up (how many tests could be taken at
once? How many rows of results could be stored in a table before it bogs
down?)
> >
> > 2. At what point will we need a dedicated server instead of
shared-hosting?
> >
> > 3. How fast of a server do we need? Will a 1ghz server outperform a
500mhz server when using apache-php-mysql?
> >
> > 4. If we need a new database, what is the next step above mysql? I have
some experience with Oracle but it is too expensive. Is there anything
inbetween that is friendly to PHP?
> >
> > 5. If MS-SQL is an option for a database-upgrade. What are the
implications of switching our server to a win32-based server? Will we have
problems with PHP on windows when all of our scripts were programmed for
unix?
> >
> > I realize these are a lot of questions and that we probably need some
consulting work done, but if any of you could share your knowledge on any
one of those topics I would really appreciate it. I just need something to
give me a head start in my research. Point me in the right direction!
> >
> > - Doug Schasteen
> >   [EMAIL PROTECTED]
> >
> > P.S. - if you know of any good articles online that compare different
servers or databases please share.
>
>
> --
> 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] What PHP4 use for connection to MSSQL?

2001-04-17 Thread John Lim


""Frank M. Kromann"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ODBC and ADO uses the same type of connection. In fact you need an ODBC
DSN to connect to a database using ADO.

Not quite true. ADO is designed so that it can use ODBC internally, or a
different technology called OLEDB. OLEDB is faster than ODBC. See the
benchmark link i gave below.

>
> The MSSQL functions in PHP uses a native communication with the database.
This communications is faster than using ODBC but it is not as easy moving
to other databases as it would be using ODBC, RDO or ADO (or whatever
Microsoft is adding on top of ODBC)
>
> - Frank
>
> > For some examples of connecting PHP to ODBC, visit
> > http://php.weblogs.com/odbc
> >
> > As to speed, definitely MSSQL using PHP is very fast. See some
benchmarks:
> > http://php.weblogs.com/adodb_benchmarks
> >
> > Try the ADODB database wrapper library also. It's ADO for PHP!
> > http://php.weblogs.com/adodb (I'm the author).
> >
> > Regards, John
> >
> > "Yevgeny Dyatlov" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Hello ,
> > >
> > >   Can somebody help me with a question:
> > >   ASP use for connection to MSSQL the OLE DB for SQL Server, someone
> > >   tell that it's cool because it better & faster than ODBC. But in
> > >   PHP4 there are functions both for ODBC & MSSQL. In FAQ on
> > >   www.php.net - 'On Windows 95/NT machines, you can simply use the
> > >   included ODBC support and the correct ODBC driver.'
> > >   Please help! What it work in fact? And what (ASP or PHP) will faster
> > >   work with MSSQL on WinNT with MS IIS?
> > >
> > > --
> > > Best regards,
> > >  Yevgeny  mailto:[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]
> >
> >
> >
>
>
>
>
> --
> 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] What PHP4 use for connection to MSSQL?

2001-04-17 Thread John Lim

For some examples of connecting PHP to ODBC, visit
http://php.weblogs.com/odbc

As to speed, definitely MSSQL using PHP is very fast. See some benchmarks:
http://php.weblogs.com/adodb_benchmarks

Try the ADODB database wrapper library also. It's ADO for PHP!
http://php.weblogs.com/adodb (I'm the author).

Regards, John

"Yevgeny Dyatlov" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello ,
>
>   Can somebody help me with a question:
>   ASP use for connection to MSSQL the OLE DB for SQL Server, someone
>   tell that it's cool because it better & faster than ODBC. But in
>   PHP4 there are functions both for ODBC & MSSQL. In FAQ on
>   www.php.net - 'On Windows 95/NT machines, you can simply use the
>   included ODBC support and the correct ODBC driver.'
>   Please help! What it work in fact? And what (ASP or PHP) will faster
>   work with MSSQL on WinNT with MS IIS?
>
> --
> Best regards,
>  Yevgeny  mailto:[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]