php-general Digest 24 Jul 2006 06:26:36 -0000 Issue 4255

Topics (messages 239710 through 239718):

parse text file
        239710 by: Benjamin Adams
        239711 by: Joe Wollard
        239712 by: Sameer N Ingole
        239713 by: Stut
        239715 by: Benjamin Adams

Re: Step by step code running
        239714 by: Robert Cummings

PHP on IIS and MS SQL 2000
        239716 by: Igor Kryltsov
        239717 by: Frank M. Kromann
        239718 by: Igor Kryltsov

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
how would I read a file one line at a time:

<?php
if($lines < $alllines){ 
    $newline .= $lines;
}
?>

something like that, I'm cofused on if I use fread, something  which
will do one line at a time?

--- End Message ---
--- Begin Message ---
Benjamin,

Use the file() function, it will read a file then return each line as
a new element in an array.
http://php.net/file

- Joe

On 7/23/06, Benjamin Adams <[EMAIL PROTECTED]> wrote:
how would I read a file one line at a time:

<?php
if($lines < $alllines){
    $newline .= $lines;
}
?>

something like that, I'm cofused on if I use fread, something  which
will do one line at a time?

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



--- End Message ---
--- Begin Message ---
Joe Wollard wrote:
Benjamin,

Use the file() function, it will read a file then return each line as
a new element in an array.
http://php.net/file
And if file is big (biiiiiiig) then you want
http://php.net/fgets

--
Sameer N. Ingole
http://weblogic.noroot.org/
---
Better to light one candle than to curse the darkness.

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe Wollard wrote:
> Use the file() function, it will read a file then return each line as
> a new element in an array.
> http://php.net/file

This will not read the file "one line at a time". Try http://php.net/fgets.

- -Stut

> On 7/23/06, Benjamin Adams <[EMAIL PROTECTED]> wrote:
>> how would I read a file one line at a time:
>>
>> <?php
>> if($lines < $alllines){
>>     $newline .= $lines;
>> }
>> ?>
>>
>> something like that, I'm cofused on if I use fread, something  which
>> will do one line at a time?
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEw9uX2WdB7L+YMm4RAvR3AJ4rsGP3ZUGBRuoEiv8ilwB9wzyu1wCggOm6
6ctTQ1Xufn0rStHFLcyOFB0=
=dGhv
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
Thanks, fgets works great  didn't know the function before.

On Mon, 2006-07-24 at 01:56 +0530, Sameer N Ingole wrote:
> Joe Wollard wrote:
> > Benjamin,
> >
> > Use the file() function, it will read a file then return each line as
> > a new element in an array.
> > http://php.net/file
> And if file is big (biiiiiiig) then you want
> http://php.net/fgets
> 
> -- 
> Sameer N. Ingole
> http://weblogic.noroot.org/
> ---
> Better to light one candle than to curse the darkness.
> 

--- End Message ---
--- Begin Message ---
On Sun, 2006-07-23 at 08:51, Ryan A wrote:
> Hi,
> 
> I need to explain a script to a pal of mine but either
> i cant explain it properly or he just cant get the
> concept being new to php's slightly "advanced stuff"
> (OO and classes, mind you...i ain't no expert myself
> in this, more like Jochem's(from this list) field of
> expertise)
> 
> I remember in my old C++ days we used to use something
> that basically showed how the code executed, line by
> line, running in the loops etc
> 
> anything like that for PHP?
> 
> Personally I use EditPlus and a lot of echo/print
> statements when I debug, I try to keep things simple.

You're looking for a debugger. There's a whole thread on the go right
now for "PHP Debugger Recommendations". Personally I prefer the
echo/print_r method that you're probably already using... but as you say
you're trying to demonstrate so that's a bit different.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Our story is....
We started building our application back in 2002 on FreeBSD/Apache with
PostgreSQL.

Than company we are working for became bigger and they bought SQL 2000
server and we had to switch to MS SQL 2000.

Now company became even more bigger and they decided that keeping FreeBSD
server which nobody knows and nobody wants to learn in IT department is a
risk and we have been asked to move from FreeBSD/Apache to Win 2000/ IIS 5.

Back in 2002 we choose ADODB as db abstraction library.

With OS switched we noticed a few things:

1) ado-mssql driver which uses mssql_* calls in PHP has a problem of
returning only first 255 characters for VARCHARs. I can not agree that
casting varchars as text in SQL queries solves this problem (it may be
solves it for simple applications) as TEXT datatype has many limitations on
its use in SQL queries - you can't use LIKE and DISTINCT and other.

2) ado-ado_mssql. This one uses not ntwdblib.dll but Win COM object ADO (if
I am right)
There are no problems with varchars but COM object does not like DATETIMEs
less than 1970 and all your employees which were 'lucky' to be born before
1970  suddenly become all born in 1970.

I am not sure but it looks like choice of platform - PHP on IIS with MSSQL
is not a good idea.
And by trying to minimize IT department risk (necessity to support OS they
do not know) we maximize our application support issues.

If anybody can suggest or share experience - please do.

Thank you,

Igor Kryltsov

--- End Message ---
--- Begin Message ---
Replace php_mssql.dll with php_dblib.dll. You aæso need to create a
freetds.conf file but you remove the limitations created by ntwdblib and
you get a thread safe environment.

- Frank

> Our story is....
> We started building our application back in 2002 on FreeBSD/Apache with
> PostgreSQL.
> 
> Than company we are working for became bigger and they bought SQL 2000
> server and we had to switch to MS SQL 2000.
> 
> Now company became even more bigger and they decided that keeping
FreeBSD
> server which nobody knows and nobody wants to learn in IT department is
a
> risk and we have been asked to move from FreeBSD/Apache to Win 2000/ IIS
5.
> 
> Back in 2002 we choose ADODB as db abstraction library.
> 
> With OS switched we noticed a few things:
> 
> 1) ado-mssql driver which uses mssql_* calls in PHP has a problem of
> returning only first 255 characters for VARCHARs. I can not agree that
> casting varchars as text in SQL queries solves this problem (it may be
> solves it for simple applications) as TEXT datatype has many limitations
on
> its use in SQL queries - you can't use LIKE and DISTINCT and other.
> 
> 2) ado-ado_mssql. This one uses not ntwdblib.dll but Win COM object ADO
(if
> I am right)
> There are no problems with varchars but COM object does not like
DATETIMEs
> less than 1970 and all your employees which were 'lucky' to be born
before
> 1970  suddenly become all born in 1970.
> 
> I am not sure but it looks like choice of platform - PHP on IIS with
MSSQL
> is not a good idea.
> And by trying to minimize IT department risk (necessity to support OS
they
> do not know) we maximize our application support issues.
> 
> If anybody can suggest or share experience - please do.
> 
> Thank you,
> 
> Igor Kryltsov
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 




--- End Message ---
--- Begin Message ---
Hi Frank,

Thanks a lot for your reply.
Just to clarify (Unix style of win commands :) ):
cp php_mssql.dll  php_mssql.dll.bak
cp  php_dblib.dll php_mssql.dll

What about freetds.conf?
Just touch it or it has to have something inside?
Can you give an example in this case?
And probably most importantly where to put it, which folder?


Thank you,

Igor

""Frank M. Kromann"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Replace php_mssql.dll with php_dblib.dll. You aæso need to create a
> freetds.conf file but you remove the limitations created by ntwdblib and
> you get a thread safe environment.
>
> - Frank
>
> > Our story is....
> > We started building our application back in 2002 on FreeBSD/Apache with
> > PostgreSQL.
> >
> > Than company we are working for became bigger and they bought SQL 2000
> > server and we had to switch to MS SQL 2000.
> >
> > Now company became even more bigger and they decided that keeping
> FreeBSD
> > server which nobody knows and nobody wants to learn in IT department is
> a
> > risk and we have been asked to move from FreeBSD/Apache to Win 2000/ IIS
> 5.
> >
> > Back in 2002 we choose ADODB as db abstraction library.
> >
> > With OS switched we noticed a few things:
> >
> > 1) ado-mssql driver which uses mssql_* calls in PHP has a problem of
> > returning only first 255 characters for VARCHARs. I can not agree that
> > casting varchars as text in SQL queries solves this problem (it may be
> > solves it for simple applications) as TEXT datatype has many limitations
> on
> > its use in SQL queries - you can't use LIKE and DISTINCT and other.
> >
> > 2) ado-ado_mssql. This one uses not ntwdblib.dll but Win COM object ADO
> (if
> > I am right)
> > There are no problems with varchars but COM object does not like
> DATETIMEs
> > less than 1970 and all your employees which were 'lucky' to be born
> before
> > 1970  suddenly become all born in 1970.
> >
> > I am not sure but it looks like choice of platform - PHP on IIS with
> MSSQL
> > is not a good idea.
> > And by trying to minimize IT department risk (necessity to support OS
> they
> > do not know) we maximize our application support issues.
> >
> > If anybody can suggest or share experience - please do.
> >
> > Thank you,
> >
> > Igor Kryltsov
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>

--- End Message ---

Reply via email to