Re: [PHP] Ok then, here is a test

2012-10-13 Thread Jim Lucas

On 10/13/2012 10:42 PM, Jim Lucas wrote:

On 10/12/2012 11:42 AM, Daniel Brown wrote:

 > Well, as the adage goes, you'll catch more flies with honey than
 > with vinegar.  And considering this is the very first message I've
 > ever seen from you, it sounds like either (a) you didn't follow the
 > proper protocol, or (b) there's something in the process we need to
 > review.  If you think the issue lies on our end, you can submit a bug
 > at https://bugs.php.net/ and detail the steps to reproduce the issue.
 > If it is indeed something we need to correct, believe me, we will.  We
 > don't deliberately attempt to mislead or frustrate people, despite how
 > it might have seemed.

Well, with that said, here is a test.

I have found, in the past, that when I enable all the SPAM filtering
that I want, that 76.75.200.58/pb1.pair.com/lists.php.net mail server
gets blocked by my mail server.  It has been a while so I don't remember
what the reason was it got blocked, but I have enabled all the filtering
again, and this is my test email with the full set of filtering enabled.

Lets see if the server still gets blocked.  I will post the logs if and
when it gets blocked.

--
Jim Lucas




Well, I got it.  Seems the problem has gone away.

Never mind then.

--
Jim Lucas

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 08:41 -0700, Jim Lucas wrote:
> Daniel Brown wrote:
> > On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> >> On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >> > On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> >> > > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >> > > > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> >> > > > > clive wrote:
> >> > > > > >>
> >> > > > > >> I have no clue how big the files are, but you might want to 
> >> store them
> >> > > > > >> in a database. That can speed up things, but don't ask me 
> >> how much ;)
> >> > > > > >>
> >> > > > > >> Tijnema
> >> > > > > >>
> >> > > > > > no dude, while database are convenient, files systems are 
> >> faster, I mean
> >> > > > > > thats what they were designed for, serving files.
> >> > > > > >
> >> > > > > > For lots of files I would store them in directories and sub 
> >> directories.
> >> > > > >
> >> > > > > Yeah amen!
> >> > > > >
> >> > > > > I generally use a two character hex hash in  my main folder to 
> >> give 255
> >> > > > > sub folders each containing files.
> >> > > > >
> >> > > > > In my case the hash is calculated from some known info - e.g. 
> >> a database
> >> > > > > ID and then stored in a meta data table.
> >> > > > >
> >> > > > > Col
> >> > > > >
> >> > > > > --
> >> > > > > PHP General Mailing List (http://www.php.net/)
> >> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> >> > > > >
> >> > > > >
> >> > > >
> >> > > >Tij,
> >> > > >
> >> > > >Referring to one of my earlier posts in this thread, as a
> >> > > > refresher, database information is stored in files.  So to store 
> >> files
> >> > > > in a database means the following has to take place:
> >> > > >
> >> > > >1.) Data is uploaded to the server.
> >> > > >2.) Data is processed by the database server.
> >> > > >3.) Data is compressed and encrypted.
> >> > > >4.) Data is written to disk.
> >> > > >(4b. - optional) Data file is checked for integrity and
> >> > > > correctness of write.
> >> > > >
> >> > > >Then, to serve the content, a similar reverse occurs:
> >> > > >
> >> > > >1.) Request is sent to the server via a script.
> >> > > >2.) The script interfaces with the database to locate the
> >> > > > desired data row.
> >> > > >3.) Once located, the data is pulled in raw form from the 
> >> database file.
> >> > > >4.) The data is then decompressed and decrypted.
> >> > > >5.) The data is streamed back to the script.
> >> > > >6.) The script decides how to handle it, based upon 
> >> hard-coded options.
> >> > > >
> >> > > >For a filesystem, it's simpler.  Uploading:
> >> > > >
> >> > > >1.) Data is uploaded.
> >> > > >2.) Data is written to disk.
> >> > > >
> >> > > >Serving:
> >> > > >
> >> > > >1.) Request is sent via script, FTP, socket connection, or
> >> > > > local request.
> >> > > >2.) File is served through via the method requested.
> >> > > >
> >> > > >So there are several pros and cons for each, but just to list
> >> > > > three of each with regard to database storage:
> >> > > >
> >> > > >Pros:
> >> > > >Can be stored centralized and portable, without needing 
> >> to archive.
> >> > > >Automatically encrypted and compressed upon storage.
> >> > > >Easier and faster to search.
> >> > > >Cons:
> >> > > >Slower storage and retrieval
> >> > > >Much greater risk of corruption
> >> > > >Not always cross-compatible across platforms, versions,
> >> > > > installations, etc.
> >> > > >
> >> > > > --
> >> > > > Daniel P. Brown
> >> > >
> >> > > How sure are you about all this?
> >> > > Benchmarks?
> >> > >
> >> > > What about search time for the harddrives etc? It needs to scan the
> >> > > inode table to find the file, etc.., then it needs to locate that 
> >> file
> >> > > on the harddrive, while the second file might be on the other side of
> >> > > the disk
> >> > >
> >> > > Storing all files in one single filesystem means you have only 1 
> >> inode
> >> > > :) All data is stored at same place (atleast, it should be)
> >> > >
> >> > > Tijnema
> >> > >
> >> >
> >> >Do I have benchmarks?  No.  Do I have the time to do them now?  No.
> >> >
> >> >Do I feel confident enough that if you were to run those benchmark
> >> > tests that it would prove me right?  Damn straight.  ;-P
> >> >
> >> > --
> >> > Daniel P. Brown
> >>
> >> I think I have some time to write a simple script in a few hours, I'd
> >> like to see what the performance difference is :)
> >>
> >> Tijnema
> >>
> > 
> >Well, keep in mind that I don't expect that you'd see much
> > difference at all with a single file, but try doing multiple files of
> > ASCII and binary, various sizes, and also several simultaneous
> > connections.
> > 
> >Two other things I forgot to mention with database storage are a
> > pro an

Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Jim Lucas

Daniel Brown wrote:

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > > > clive wrote:
> > > > >>
> > > > >> I have no clue how big the files are, but you might want to 
store them
> > > > >> in a database. That can speed up things, but don't ask me 
how much ;)

> > > > >>
> > > > >> Tijnema
> > > > >>
> > > > > no dude, while database are convenient, files systems are 
faster, I mean

> > > > > thats what they were designed for, serving files.
> > > > >
> > > > > For lots of files I would store them in directories and sub 
directories.

> > > >
> > > > Yeah amen!
> > > >
> > > > I generally use a two character hex hash in  my main folder to 
give 255

> > > > sub folders each containing files.
> > > >
> > > > In my case the hash is calculated from some known info - e.g. 
a database

> > > > ID and then stored in a meta data table.
> > > >
> > > > Col
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >Tij,
> > >
> > >Referring to one of my earlier posts in this thread, as a
> > > refresher, database information is stored in files.  So to store 
files

> > > in a database means the following has to take place:
> > >
> > >1.) Data is uploaded to the server.
> > >2.) Data is processed by the database server.
> > >3.) Data is compressed and encrypted.
> > >4.) Data is written to disk.
> > >(4b. - optional) Data file is checked for integrity and
> > > correctness of write.
> > >
> > >Then, to serve the content, a similar reverse occurs:
> > >
> > >1.) Request is sent to the server via a script.
> > >2.) The script interfaces with the database to locate the
> > > desired data row.
> > >3.) Once located, the data is pulled in raw form from the 
database file.

> > >4.) The data is then decompressed and decrypted.
> > >5.) The data is streamed back to the script.
> > >6.) The script decides how to handle it, based upon 
hard-coded options.

> > >
> > >For a filesystem, it's simpler.  Uploading:
> > >
> > >1.) Data is uploaded.
> > >2.) Data is written to disk.
> > >
> > >Serving:
> > >
> > >1.) Request is sent via script, FTP, socket connection, or
> > > local request.
> > >2.) File is served through via the method requested.
> > >
> > >So there are several pros and cons for each, but just to list
> > > three of each with regard to database storage:
> > >
> > >Pros:
> > >Can be stored centralized and portable, without needing 
to archive.

> > >Automatically encrypted and compressed upon storage.
> > >Easier and faster to search.
> > >Cons:
> > >Slower storage and retrieval
> > >Much greater risk of corruption
> > >Not always cross-compatible across platforms, versions,
> > > installations, etc.
> > >
> > > --
> > > Daniel P. Brown
> >
> > How sure are you about all this?
> > Benchmarks?
> >
> > What about search time for the harddrives etc? It needs to scan the
> > inode table to find the file, etc.., then it needs to locate that 
file

> > on the harddrive, while the second file might be on the other side of
> > the disk
> >
> > Storing all files in one single filesystem means you have only 1 
inode

> > :) All data is stored at same place (atleast, it should be)
> >
> > Tijnema
> >
>
>Do I have benchmarks?  No.  Do I have the time to do them now?  No.
>
>Do I feel confident enough that if you were to run those benchmark
> tests that it would prove me right?  Damn straight.  ;-P
>
> --
> Daniel P. Brown

I think I have some time to write a simple script in a few hours, I'd
like to see what the performance difference is :)

Tijnema



   Well, keep in mind that I don't expect that you'd see much
difference at all with a single file, but try doing multiple files of
ASCII and binary, various sizes, and also several simultaneous
connections.

   Two other things I forgot to mention with database storage are a
pro and con, respectively - caching and accessibility.



and the fact that a lot of hosting environments have a DB on a different 
machine.

This would make for a much worse performance then the local filesystem.

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 11:25 -0400, Daniel Brown wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > > >Referring to one of my earlier posts in this thread, as a
> > > > > refresher, database information is stored in files.  So to store files
> > > > > in a database means the following has to take place:
> > > > >
> > > > >1.) Data is uploaded to the server.
> > > > >2.) Data is processed by the database server.
> > > > >3.) Data is compressed and encrypted.
> > > > >4.) Data is written to disk.
> > > > >(4b. - optional) Data file is checked for integrity and
> > > > > correctness of write.
> > > > >
> > > > >Then, to serve the content, a similar reverse occurs:
> > > > >
> > > > >1.) Request is sent to the server via a script.
> > > > >2.) The script interfaces with the database to locate the
> > > > > desired data row.
> > > > >3.) Once located, the data is pulled in raw form from the 
> > > > > database file.
> > > > >4.) The data is then decompressed and decrypted.
> > > > >5.) The data is streamed back to the script.
> > > > >6.) The script decides how to handle it, based upon hard-coded 
> > > > > options.
> > > > >
> > > > >For a filesystem, it's simpler.  Uploading:
> > > > >
> > > > >1.) Data is uploaded.
> > > > >2.) Data is written to disk.

This isn't quite correct. There are numerous databases that allow you to
assign a raw partition and they manage the filesystem themselves thus
the intermediate OS dependence is eliminated. As such, the database
probably wins in this situation since you also get rapid searching on
any meta data fields and since you probably have to issue a query
anyways (for either approach), this approach is superior since you no
longer need to interact with the filesystem at all. The only negative is
that writing to the database will be less efficient due to escaping of
the data. But reading will be much faster. And in practice, I'd wager,
it's rare that images are created more often than read.

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.  |
`'

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Daniel Brown

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > > > clive wrote:
> > > > >>
> > > > >> I have no clue how big the files are, but you might want to store 
them
> > > > >> in a database. That can speed up things, but don't ask me how much ;)
> > > > >>
> > > > >> Tijnema
> > > > >>
> > > > > no dude, while database are convenient, files systems are faster, I 
mean
> > > > > thats what they were designed for, serving files.
> > > > >
> > > > > For lots of files I would store them in directories and sub 
directories.
> > > >
> > > > Yeah amen!
> > > >
> > > > I generally use a two character hex hash in  my main folder to give 255
> > > > sub folders each containing files.
> > > >
> > > > In my case the hash is calculated from some known info - e.g. a database
> > > > ID and then stored in a meta data table.
> > > >
> > > > Col
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >Tij,
> > >
> > >Referring to one of my earlier posts in this thread, as a
> > > refresher, database information is stored in files.  So to store files
> > > in a database means the following has to take place:
> > >
> > >1.) Data is uploaded to the server.
> > >2.) Data is processed by the database server.
> > >3.) Data is compressed and encrypted.
> > >4.) Data is written to disk.
> > >(4b. - optional) Data file is checked for integrity and
> > > correctness of write.
> > >
> > >Then, to serve the content, a similar reverse occurs:
> > >
> > >1.) Request is sent to the server via a script.
> > >2.) The script interfaces with the database to locate the
> > > desired data row.
> > >3.) Once located, the data is pulled in raw form from the database 
file.
> > >4.) The data is then decompressed and decrypted.
> > >5.) The data is streamed back to the script.
> > >6.) The script decides how to handle it, based upon hard-coded 
options.
> > >
> > >For a filesystem, it's simpler.  Uploading:
> > >
> > >1.) Data is uploaded.
> > >2.) Data is written to disk.
> > >
> > >Serving:
> > >
> > >1.) Request is sent via script, FTP, socket connection, or
> > > local request.
> > >2.) File is served through via the method requested.
> > >
> > >So there are several pros and cons for each, but just to list
> > > three of each with regard to database storage:
> > >
> > >Pros:
> > >Can be stored centralized and portable, without needing to archive.
> > >Automatically encrypted and compressed upon storage.
> > >Easier and faster to search.
> > >Cons:
> > >Slower storage and retrieval
> > >Much greater risk of corruption
> > >Not always cross-compatible across platforms, versions,
> > > installations, etc.
> > >
> > > --
> > > Daniel P. Brown
> >
> > How sure are you about all this?
> > Benchmarks?
> >
> > What about search time for the harddrives etc? It needs to scan the
> > inode table to find the file, etc.., then it needs to locate that file
> > on the harddrive, while the second file might be on the other side of
> > the disk
> >
> > Storing all files in one single filesystem means you have only 1 inode
> > :) All data is stored at same place (atleast, it should be)
> >
> > Tijnema
> >
>
>Do I have benchmarks?  No.  Do I have the time to do them now?  No.
>
>Do I feel confident enough that if you were to run those benchmark
> tests that it would prove me right?  Damn straight.  ;-P
>
> --
> Daniel P. Brown

I think I have some time to write a simple script in a few hours, I'd
like to see what the performance difference is :)

Tijnema



   Well, keep in mind that I don't expect that you'd see much
difference at all with a single file, but try doing multiple files of
ASCII and binary, various sizes, and also several simultaneous
connections.

   Two other things I forgot to mention with database storage are a
pro and con, respectively - caching and accessibility.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Tijnema

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > > clive wrote:
> > > >>
> > > >> I have no clue how big the files are, but you might want to store them
> > > >> in a database. That can speed up things, but don't ask me how much ;)
> > > >>
> > > >> Tijnema
> > > >>
> > > > no dude, while database are convenient, files systems are faster, I mean
> > > > thats what they were designed for, serving files.
> > > >
> > > > For lots of files I would store them in directories and sub directories.
> > >
> > > Yeah amen!
> > >
> > > I generally use a two character hex hash in  my main folder to give 255
> > > sub folders each containing files.
> > >
> > > In my case the hash is calculated from some known info - e.g. a database
> > > ID and then stored in a meta data table.
> > >
> > > Col
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >Tij,
> >
> >Referring to one of my earlier posts in this thread, as a
> > refresher, database information is stored in files.  So to store files
> > in a database means the following has to take place:
> >
> >1.) Data is uploaded to the server.
> >2.) Data is processed by the database server.
> >3.) Data is compressed and encrypted.
> >4.) Data is written to disk.
> >(4b. - optional) Data file is checked for integrity and
> > correctness of write.
> >
> >Then, to serve the content, a similar reverse occurs:
> >
> >1.) Request is sent to the server via a script.
> >2.) The script interfaces with the database to locate the
> > desired data row.
> >3.) Once located, the data is pulled in raw form from the database 
file.
> >4.) The data is then decompressed and decrypted.
> >5.) The data is streamed back to the script.
> >6.) The script decides how to handle it, based upon hard-coded 
options.
> >
> >For a filesystem, it's simpler.  Uploading:
> >
> >1.) Data is uploaded.
> >2.) Data is written to disk.
> >
> >Serving:
> >
> >1.) Request is sent via script, FTP, socket connection, or
> > local request.
> >2.) File is served through via the method requested.
> >
> >So there are several pros and cons for each, but just to list
> > three of each with regard to database storage:
> >
> >Pros:
> >Can be stored centralized and portable, without needing to archive.
> >Automatically encrypted and compressed upon storage.
> >Easier and faster to search.
> >Cons:
> >Slower storage and retrieval
> >Much greater risk of corruption
> >Not always cross-compatible across platforms, versions,
> > installations, etc.
> >
> > --
> > Daniel P. Brown
>
> How sure are you about all this?
> Benchmarks?
>
> What about search time for the harddrives etc? It needs to scan the
> inode table to find the file, etc.., then it needs to locate that file
> on the harddrive, while the second file might be on the other side of
> the disk
>
> Storing all files in one single filesystem means you have only 1 inode
> :) All data is stored at same place (atleast, it should be)
>
> Tijnema
>

   Do I have benchmarks?  No.  Do I have the time to do them now?  No.

   Do I feel confident enough that if you were to run those benchmark
tests that it would prove me right?  Damn straight.  ;-P

--
Daniel P. Brown


I think I have some time to write a simple script in a few hours, I'd
like to see what the performance difference is :)

Tijnema

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Daniel Brown

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > clive wrote:
> > >>
> > >> I have no clue how big the files are, but you might want to store them
> > >> in a database. That can speed up things, but don't ask me how much ;)
> > >>
> > >> Tijnema
> > >>
> > > no dude, while database are convenient, files systems are faster, I mean
> > > thats what they were designed for, serving files.
> > >
> > > For lots of files I would store them in directories and sub directories.
> >
> > Yeah amen!
> >
> > I generally use a two character hex hash in  my main folder to give 255
> > sub folders each containing files.
> >
> > In my case the hash is calculated from some known info - e.g. a database
> > ID and then stored in a meta data table.
> >
> > Col
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>Tij,
>
>Referring to one of my earlier posts in this thread, as a
> refresher, database information is stored in files.  So to store files
> in a database means the following has to take place:
>
>1.) Data is uploaded to the server.
>2.) Data is processed by the database server.
>3.) Data is compressed and encrypted.
>4.) Data is written to disk.
>(4b. - optional) Data file is checked for integrity and
> correctness of write.
>
>Then, to serve the content, a similar reverse occurs:
>
>1.) Request is sent to the server via a script.
>2.) The script interfaces with the database to locate the
> desired data row.
>3.) Once located, the data is pulled in raw form from the database 
file.
>4.) The data is then decompressed and decrypted.
>5.) The data is streamed back to the script.
>6.) The script decides how to handle it, based upon hard-coded options.
>
>For a filesystem, it's simpler.  Uploading:
>
>1.) Data is uploaded.
>2.) Data is written to disk.
>
>Serving:
>
>1.) Request is sent via script, FTP, socket connection, or
> local request.
>2.) File is served through via the method requested.
>
>So there are several pros and cons for each, but just to list
> three of each with regard to database storage:
>
>Pros:
>Can be stored centralized and portable, without needing to archive.
>Automatically encrypted and compressed upon storage.
>Easier and faster to search.
>Cons:
>Slower storage and retrieval
>Much greater risk of corruption
>Not always cross-compatible across platforms, versions,
> installations, etc.
>
> --
> Daniel P. Brown

How sure are you about all this?
Benchmarks?

What about search time for the harddrives etc? It needs to scan the
inode table to find the file, etc.., then it needs to locate that file
on the harddrive, while the second file might be on the other side of
the disk

Storing all files in one single filesystem means you have only 1 inode
:) All data is stored at same place (atleast, it should be)

Tijnema



   Do I have benchmarks?  No.  Do I have the time to do them now?  No.

   Do I feel confident enough that if you were to run those benchmark
tests that it would prove me right?  Damn straight.  ;-P

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Tijnema

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> clive wrote:
> >>
> >> I have no clue how big the files are, but you might want to store them
> >> in a database. That can speed up things, but don't ask me how much ;)
> >>
> >> Tijnema
> >>
> > no dude, while database are convenient, files systems are faster, I mean
> > thats what they were designed for, serving files.
> >
> > For lots of files I would store them in directories and sub directories.
>
> Yeah amen!
>
> I generally use a two character hex hash in  my main folder to give 255
> sub folders each containing files.
>
> In my case the hash is calculated from some known info - e.g. a database
> ID and then stored in a meta data table.
>
> Col
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Tij,

   Referring to one of my earlier posts in this thread, as a
refresher, database information is stored in files.  So to store files
in a database means the following has to take place:

   1.) Data is uploaded to the server.
   2.) Data is processed by the database server.
   3.) Data is compressed and encrypted.
   4.) Data is written to disk.
   (4b. - optional) Data file is checked for integrity and
correctness of write.

   Then, to serve the content, a similar reverse occurs:

   1.) Request is sent to the server via a script.
   2.) The script interfaces with the database to locate the
desired data row.
   3.) Once located, the data is pulled in raw form from the database file.
   4.) The data is then decompressed and decrypted.
   5.) The data is streamed back to the script.
   6.) The script decides how to handle it, based upon hard-coded options.

   For a filesystem, it's simpler.  Uploading:

   1.) Data is uploaded.
   2.) Data is written to disk.

   Serving:

   1.) Request is sent via script, FTP, socket connection, or
local request.
   2.) File is served through via the method requested.

   So there are several pros and cons for each, but just to list
three of each with regard to database storage:

   Pros:
   Can be stored centralized and portable, without needing to archive.
   Automatically encrypted and compressed upon storage.
   Easier and faster to search.
   Cons:
   Slower storage and retrieval
   Much greater risk of corruption
   Not always cross-compatible across platforms, versions,
installations, etc.

--
Daniel P. Brown


How sure are you about all this?
Benchmarks?

What about search time for the harddrives etc? It needs to scan the
inode table to find the file, etc.., then it needs to locate that file
on the harddrive, while the second file might be on the other side of
the disk

Storing all files in one single filesystem means you have only 1 inode
:) All data is stored at same place (atleast, it should be)

Tijnema

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Daniel Brown

On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:

clive wrote:
>>
>> I have no clue how big the files are, but you might want to store them
>> in a database. That can speed up things, but don't ask me how much ;)
>>
>> Tijnema
>>
> no dude, while database are convenient, files systems are faster, I mean
> thats what they were designed for, serving files.
>
> For lots of files I would store them in directories and sub directories.

Yeah amen!

I generally use a two character hex hash in  my main folder to give 255
sub folders each containing files.

In my case the hash is calculated from some known info - e.g. a database
ID and then stored in a meta data table.

Col

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




   Tij,

   Referring to one of my earlier posts in this thread, as a
refresher, database information is stored in files.  So to store files
in a database means the following has to take place:

   1.) Data is uploaded to the server.
   2.) Data is processed by the database server.
   3.) Data is compressed and encrypted.
   4.) Data is written to disk.
   (4b. - optional) Data file is checked for integrity and
correctness of write.

   Then, to serve the content, a similar reverse occurs:

   1.) Request is sent to the server via a script.
   2.) The script interfaces with the database to locate the
desired data row.
   3.) Once located, the data is pulled in raw form from the database file.
   4.) The data is then decompressed and decrypted.
   5.) The data is streamed back to the script.
   6.) The script decides how to handle it, based upon hard-coded options.

   For a filesystem, it's simpler.  Uploading:

   1.) Data is uploaded.
   2.) Data is written to disk.

   Serving:

   1.) Request is sent via script, FTP, socket connection, or
local request.
   2.) File is served through via the method requested.

   So there are several pros and cons for each, but just to list
three of each with regard to database storage:

   Pros:
   Can be stored centralized and portable, without needing to archive.
   Automatically encrypted and compressed upon storage.
   Easier and faster to search.
   Cons:
   Slower storage and retrieval
   Much greater risk of corruption
   Not always cross-compatible across platforms, versions,
installations, etc.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



[PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Colin Guthrie
clive wrote:
>>
>> I have no clue how big the files are, but you might want to store them
>> in a database. That can speed up things, but don't ask me how much ;)
>>
>> Tijnema
>>
> no dude, while database are convenient, files systems are faster, I mean
> thats what they were designed for, serving files.
> 
> For lots of files I would store them in directories and sub directories.

Yeah amen!

I generally use a two character hex hash in  my main folder to give 255
sub folders each containing files.

In my case the hash is calculated from some known info - e.g. a database
ID and then stored in a meta data table.

Col

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



[PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread clive


I have no clue how big the files are, but you might want to store them
in a database. That can speed up things, but don't ask me how much ;)

Tijnema

no dude, while database are convenient, files systems are faster, I mean 
thats what they were designed for, serving files.


For lots of files I would store them in directories and sub directories.

-
--
Regards,

Clive.

Real Time Travel Connections


{No electrons were harmed in the creation, transmission or reading of 
this email. However, many were excited and some may well have enjoyed 
the experience.}


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



Re: [PHP] OK to have many files in one folder?

2007-06-17 Thread Tijnema

On 6/17/07, Brian Dunning <[EMAIL PROTECTED]> wrote:

For everyone who advised me to "beware the inode", allow me to
forward what the Rackspace admins told me. This is Greek to me, and
I'm hoping one of you can translate. All I understood was where he
said "I appear to have more than enough." Yes?

---snip---

All of your slices on the disk are ext3. As this is the only file
system that the Red Hat kernel provides support for.

[EMAIL PROTECTED] ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda5 ext3 227G 93G 123G 43% /
/dev/hda1 ext3 99M 12M 83M 12% /boot
none tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/hda2 ext3 2.0G 36M 1.9G 2% /tmp

As far as I am able to recall, there are only 2 limitations that you
must be concerned with. There might be others, but these are the only
ones I am aware of, which also appears to be true from the research I
have done.

1. The number if i-nodes. You appear to have more than enough.

[EMAIL PROTECTED] ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/hda5 30130176 3729871 26400305 13% /
/dev/hda1 26104 46 26058 1% /boot
none 220613 1 220612 1% /dev/shm
/dev/hda2 262144 18 262126 1% /tmp

2. The subdirectory limitation for the ext3 file system. You can only
have 32000 subdirectories with in any directory.


Enough Inodes, and 32000 subdirectory's is quiet a lot, and definitly
not a problem if you place all files in one directory ;)
But, speed is a different story, so you might want to test how it
works when you store the files in a database, it might be faster...

Tijnema

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



Re: [PHP] OK to have many files in one folder?

2007-06-17 Thread Brian Dunning
For everyone who advised me to "beware the inode", allow me to  
forward what the Rackspace admins told me. This is Greek to me, and  
I'm hoping one of you can translate. All I understood was where he  
said "I appear to have more than enough." Yes?


---snip---

All of your slices on the disk are ext3. As this is the only file  
system that the Red Hat kernel provides support for.


[EMAIL PROTECTED] ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda5 ext3 227G 93G 123G 43% /
/dev/hda1 ext3 99M 12M 83M 12% /boot
none tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/hda2 ext3 2.0G 36M 1.9G 2% /tmp

As far as I am able to recall, there are only 2 limitations that you  
must be concerned with. There might be others, but these are the only  
ones I am aware of, which also appears to be true from the research I  
have done.


1. The number if i-nodes. You appear to have more than enough.

[EMAIL PROTECTED] ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/hda5 30130176 3729871 26400305 13% /
/dev/hda1 26104 46 26058 1% /boot
none 220613 1 220612 1% /dev/shm
/dev/hda2 262144 18 262126 1% /tmp

2. The subdirectory limitation for the ext3 file system. You can only  
have 32000 subdirectories with in any directory.


---/snip---

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



RE: [PHP] OK to have many files in one folder?

2007-06-15 Thread Jay Blanchard
[snip]
> Two words. Beware the inode. 
  ^^ ^^^ ^
1 23

Here endeth the lesson.
[/snip]

Can I get an Admin brotha'!?

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Stut

Jay Blanchard wrote:

[snip]
Server is running Linux, and PHP is constantly creating and modifying  
images in a directory. Apache is constantly serving these same  
images. There are about 250,000 of them in the same directory. Seems  
to be running OK, no problematic CPU load, but I'm wondering if  
anyone knows whether I'm living dangerously having that many docs in  
one directory with that much activity. It is an extremely busy server.


Sorry is this seems like more of a linux sysad question than a PHP  
question. Thanks...  :)

[/snip]

Two words. Beware the inode. 

 ^^ ^^^ ^
   1 23

Here endeth the lesson.

-Stut

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Crayon Shin Chan
On Saturday 16 June 2007 03:47, Daniel Brown wrote:

> Once again, this doesn't matter so much for per-directory (though
> listing will take longer, as I think I mentioned) as it does the
> filesystem mount. 

Several years ago, having say 3000+ files in single directory on ext2 
would mean that a simple 'ls -al' takes several orders of magnitude 
longer to perform than on a directory with just several hundred files. As 
I haven't used ext2/3 for ages I don't know whether the same is still 
true today.

> The ext2/ext3 filesystems were made for these 
> reasons, especially with journaling like ReiserFS, XFS, et cetera
> (which is a completely different bag of nuts).

Not sure what point you're trying to make here, but, of the common 
filesystems for linux, ext2/3 is the absolute slowest (by far) when you 
have a large number of files in a directory.

-- 
Crayon

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Satyam
Since it depends on many factors, some out of your control, some others that 
might vary over the lifetime of the application, one thing you might do, to 
be on the safe side is try to put files in different directories, for 
example, by breaking up their filenames every three characters and making 
each segment a folder but no more than three levels deep so that the file 
./abcdefghijkl.jpg would be located at ./abc/def/ghijkl.jpg.  This breakup 
would allow even to mount extra disk volumes for some of the folders, should 
they exceed certain capacity or to split the risk.  Whether to break 
filenames every two, three or more characters might be a matter of 
optimization, but I would guess that around three (or four) for the first 
two segments and whatever is left for the filename would be a reasonable 
number.  I wouldn't go more than three levels deep either, because jumping 
from one directory level to the next also takes some time, thus it is a 
compromise in between searching sequentially in a directory for a filename 
(for those filesystems that do so) and going deep into the directory tree.


Satyam



- Original Message - 
From: "Brian Dunning" <[EMAIL PROTECTED]>

To: 
Sent: Friday, June 15, 2007 9:38 PM
Subject: Re: [PHP] OK to have many files in one folder?


Thanks for the replies but I'm not sure I know what to do with them.  Is 
the problem with the number of files, or is the problem with the 
activity? Can you dumb down your answers at all for me?  :)



On Jun 15, 2007, at 11:51 AM, Daniel Brown wrote:


6/15/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
Server is running Linux, and PHP is constantly creating and modifying
images in a directory. Apache is constantly serving these same
images. There are about 250,000 of them in the same directory. Seems
to be running OK, no problematic CPU load, but I'm wondering if
anyone knows whether I'm living dangerously having that many docs in
one directory with that much activity. It is an extremely busy  server.

Sorry is this seems like more of a linux sysad question than a PHP
question. Thanks...  :)
[/snip]

Two words. Beware the inode.

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




   If that directory is all on one single partition, God help you if
there's any corruption.  Check into RAID 0+1/RAID 5 disk striping if
you've got that many images.  And remember, the fact that they're all
in one directory doesn't matter at all to the system, as directories,
folders, et cetera, are just representations for human readability and
organization.  In fact, those files reside on several sectors
throughout the drive, and each file itself is probably fragmented many
times.

   Just for fun, though, if you want to crash your server, you  could 
always do:

   `while [ 1 = 1 ]; do ls -l;done`

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



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



--
No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 
269.8.16/849 - Release Date: 14/06/2007 12:44





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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Daniel Brown

On 6/15/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
I can easily break it up into 100 subdirectories, 2500 files in each,
would that be good insurance against problems?
[/snip]

As someone mentioned, directories are just a human convenience. Each
file will have an inode and is identified by an inode number in the file
system where it resides. Inodes store information on files such as user
and group ownership, access mode (read, write, execute permissions) and
type of file. There is a fixed number of inodes, which indicates the
maximum number of files each filesystem can hold. Hence, beware the
inode.

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




   Perfect, Jay.  That's something I forgot to mention.  Also, keep
in mind that, while there are file byte size limits (4GB, 8GB, etc.),
directories are NOT limited in byte size.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Daniel Brown

On 6/15/07, Brian Dunning <[EMAIL PROTECTED]> wrote:

Thanks for the replies but I'm not sure I know what to do with them.
Is the problem with the number of files, or is the problem with the
activity? Can you dumb down your answers at all for me?  :)


On Jun 15, 2007, at 11:51 AM, Daniel Brown wrote:

> 6/15/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:
>> [snip]
>> Server is running Linux, and PHP is constantly creating and modifying
>> images in a directory. Apache is constantly serving these same
>> images. There are about 250,000 of them in the same directory. Seems
>> to be running OK, no problematic CPU load, but I'm wondering if
>> anyone knows whether I'm living dangerously having that many docs in
>> one directory with that much activity. It is an extremely busy
>> server.
>>
>> Sorry is this seems like more of a linux sysad question than a PHP
>> question. Thanks...  :)
>> [/snip]
>>
>> Two words. Beware the inode.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>If that directory is all on one single partition, God help you if
> there's any corruption.  Check into RAID 0+1/RAID 5 disk striping if
> you've got that many images.  And remember, the fact that they're all
> in one directory doesn't matter at all to the system, as directories,
> folders, et cetera, are just representations for human readability and
> organization.  In fact, those files reside on several sectors
> throughout the drive, and each file itself is probably fragmented many
> times.
>
>Just for fun, though, if you want to crash your server, you
> could always do:
>`while [ 1 = 1 ]; do ls -l;done`
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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




   Brian,

   I stand behind my suggestion, though I also suggest you take
whatever everyone else says into consideration just as much as me.  I
have well over a decade of experience, but I'll be the first to admit
that sometimes a teenage computer geek is more correct than I am.

   Yes, list, believe it or not, I'm not always correct.  I'm just
going to let that sink in a little bit.

   Okay, now that everyone is done laughing at me (well, mostly
everyone), let's get on with it.

   I still think it's best to split the files across a RAID.  Ask
your datacenter to discuss the pros and cons of both RAID 0+1 and RAID
5 with you, and research it on the web.  It would be better to split
the files into different directories, as well, but *probably* is not
necessary.  Take that as you will.

   That said, one way of doing it that is very common is to create a
minimum of 36 directories, from 0 - 9 and a - z.  Each directory
should contain only files where the first character is the same as the
directory within which it resides.  However, if you have a specific
character that comes up much more frequently than others, or even all
the time, this won't work, of course.

   The point is, in my experience, holding even a terabyte of data in
smaller files within one directory is not a Bad Thing [tm], per se.
I've administered MySQL databases on servers that were in the
two-to-three terabyte range, and one of which had well over 3,000
separate tables.  Each of those tables is three separate files
(minimum) on disk, mind you: table.frm, table.MYD, table.MYI.  Also,
keep in mind that I didn't create the database structure, but was
instead hired to ensure that it ran smoothly.  In the four months and
n-million queries that were run on it while it was in use, the server
responded as if it were a standard 50MB database in under a dozen
files (if memory serves, it was a Dual Xeon 2.6GHz with 4GB RAM) and
only used for MySQL).  After the project was completed, however, we
did upgrade the systems to a distributed network for further
expansion, but I think you get the point there.

   Bottom line, however, is that just because you're not experiencing
problems now doesn't mean you won't soon in the future.  Seriously
consider, with that many separate files and that much data, how much
it's worth to you in the long run, and if a RAID setup and
directory-splitting is a Good Thing [tm] for your situation.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Tijnema

On 6/15/07, Brian Dunning <[EMAIL PROTECTED]> wrote:

I can easily break it up into 100 subdirectories, 2500 files in each,
would that be good insurance against problems?



I have no clue how big the files are, but you might want to store them
in a database. That can speed up things, but don't ask me how much ;)

Tijnema

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



RE: [PHP] OK to have many files in one folder?

2007-06-15 Thread Jay Blanchard
[snip]
I can easily break it up into 100 subdirectories, 2500 files in each,  
would that be good insurance against problems?
[/snip]

As someone mentioned, directories are just a human convenience. Each
file will have an inode and is identified by an inode number in the file
system where it resides. Inodes store information on files such as user
and group ownership, access mode (read, write, execute permissions) and
type of file. There is a fixed number of inodes, which indicates the
maximum number of files each filesystem can hold. Hence, beware the
inode.

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Brian Dunning
I can easily break it up into 100 subdirectories, 2500 files in each,  
would that be good insurance against problems?


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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Daniel Brown

On 6/15/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:

On Saturday 16 June 2007 02:51, Daniel Brown wrote:

> And remember, the fact that they're all
> in one directory doesn't matter at all to the system, as directories,
> folders, et cetera, are just representations for human readability and
> organization.  In fact, those files reside on several sectors
> throughout the drive, and each file itself is probably fragmented many
> times.

Actually it does matter depending on the filesystem you use. If you're
using ext2/ext3 then having several thousand files in a directory
seriously slows things down.

--
Crayon

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




   Once again, this doesn't matter so much for per-directory (though
listing will take longer, as I think I mentioned) as it does the
filesystem mount.  The ext2/ext3 filesystems were made for these
reasons, especially with journaling like ReiserFS, XFS, et cetera
(which is a completely different bag of nuts).

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Brian Dunning
Thanks for the replies but I'm not sure I know what to do with them.  
Is the problem with the number of files, or is the problem with the  
activity? Can you dumb down your answers at all for me?  :)



On Jun 15, 2007, at 11:51 AM, Daniel Brown wrote:


6/15/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
Server is running Linux, and PHP is constantly creating and modifying
images in a directory. Apache is constantly serving these same
images. There are about 250,000 of them in the same directory. Seems
to be running OK, no problematic CPU load, but I'm wondering if
anyone knows whether I'm living dangerously having that many docs in
one directory with that much activity. It is an extremely busy  
server.


Sorry is this seems like more of a linux sysad question than a PHP
question. Thanks...  :)
[/snip]

Two words. Beware the inode.

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




   If that directory is all on one single partition, God help you if
there's any corruption.  Check into RAID 0+1/RAID 5 disk striping if
you've got that many images.  And remember, the fact that they're all
in one directory doesn't matter at all to the system, as directories,
folders, et cetera, are just representations for human readability and
organization.  In fact, those files reside on several sectors
throughout the drive, and each file itself is probably fragmented many
times.

   Just for fun, though, if you want to crash your server, you  
could always do:

   `while [ 1 = 1 ]; do ls -l;done`

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Crayon Shin Chan
On Saturday 16 June 2007 02:51, Daniel Brown wrote:

> And remember, the fact that they're all
> in one directory doesn't matter at all to the system, as directories,
> folders, et cetera, are just representations for human readability and
> organization.  In fact, those files reside on several sectors
> throughout the drive, and each file itself is probably fragmented many
> times.

Actually it does matter depending on the filesystem you use. If you're 
using ext2/ext3 then having several thousand files in a directory 
seriously slows things down.

-- 
Crayon

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



Re: [PHP] OK to have many files in one folder?

2007-06-15 Thread Daniel Brown

6/15/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
Server is running Linux, and PHP is constantly creating and modifying
images in a directory. Apache is constantly serving these same
images. There are about 250,000 of them in the same directory. Seems
to be running OK, no problematic CPU load, but I'm wondering if
anyone knows whether I'm living dangerously having that many docs in
one directory with that much activity. It is an extremely busy server.

Sorry is this seems like more of a linux sysad question than a PHP
question. Thanks...  :)
[/snip]

Two words. Beware the inode.

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




   If that directory is all on one single partition, God help you if
there's any corruption.  Check into RAID 0+1/RAID 5 disk striping if
you've got that many images.  And remember, the fact that they're all
in one directory doesn't matter at all to the system, as directories,
folders, et cetera, are just representations for human readability and
organization.  In fact, those files reside on several sectors
throughout the drive, and each file itself is probably fragmented many
times.

   Just for fun, though, if you want to crash your server, you could always do:
   `while [ 1 = 1 ]; do ls -l;done`

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



RE: [PHP] OK to have many files in one folder?

2007-06-15 Thread Jay Blanchard
[snip]
Server is running Linux, and PHP is constantly creating and modifying  
images in a directory. Apache is constantly serving these same  
images. There are about 250,000 of them in the same directory. Seems  
to be running OK, no problematic CPU load, but I'm wondering if  
anyone knows whether I'm living dangerously having that many docs in  
one directory with that much activity. It is an extremely busy server.

Sorry is this seems like more of a linux sysad question than a PHP  
question. Thanks...  :)
[/snip]

Two words. Beware the inode. 

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



Re: [PHP] Ok next php problem

2006-06-18 Thread Chris

Rob W. wrote:
Ok but my problem is is that in the process of doing that, numbers can 
be released so they pretty much haft to be dynamic. Any idea how I do it 
with that.


IE:

1
2
3
6
9
10
...

So if them numbers change, which they can, because they are assigned 
port numbers for servers, How do I make it so they are not scripted 
statically.


That was an example only.

See my next reply for an example of how to get the port from the db and 
go from there.


Since we don't know your db structure, table names, field names I made 
it "generic" and you'll have to modify to suit your needs.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Ok next php problem

2006-06-18 Thread tedd
At 7:21 PM -0500 6/18/06, Rob W. wrote:
>I got the previous question answered, Now here's my next problem.
>
>With the numbers displaying correctly again I got:
>
>1
>2
>3
>4
>5
>6
>7
>10
>11
>12
>13
>14
>15
>16
>17
>18
>19
>20
>21
>22
>25
>
>listed in that order in the database
>
>Now i'm trying to figure out how to write a syntax saying that if like number 
>8 isnt listed, display it.
>
>I've tried doing a
>
>if ($count != $data) {
>  echo "$data";
>}
>$count++;
>
>But when I get to like id number 9 it dont work right because the next entrie 
>is displayed as 10 in the db. So that's my problem is to try and display only 
>them numbers that are not in there. I have also tried putting the numbers in 
>to an array and matching from there but it still come's up as the same as 
>above.
>
>- Rob

Rob:

Why?

If you want to show the number of records in your dB, then just show them. If 
you want a counter, then add a counter but don't list the id number. Besides, 
why would you want to anyway?

tedd
-- 

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Ok next php problem

2006-06-18 Thread Rob W.
Ok but my problem is is that in the process of doing that, numbers can be 
released so they pretty much haft to be dynamic. Any idea how I do it with 
that.


IE:

1
2
3
6
9
10
...

So if them numbers change, which they can, because they are assigned port 
numbers for servers, How do I make it so they are not scripted statically.



- Original Message - 
From: "Chris" <[EMAIL PROTECTED]>

To: "Rob W." <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, June 18, 2006 8:38 PM
Subject: Re: [PHP] Ok next php problem



Rob W. wrote:

I got the previous question answered, Now here's my next problem.

With the numbers displaying correctly again I got:

1
2
3
4
5
6
7
10
11
12
13
14
15
16
17
18
19
20
21
22
25

listed in that order in the database

Now i'm trying to figure out how to write a syntax saying that if like 
number 8 isnt listed, display it.


Get them both into arrays and compare:

$good_list = range(1,10);
$db_list = array(4,7,10);

$missing = array_diff($good_list, $db_list);

http://php.net/array_diff

--
Postgresql & php tutorials
http://www.designmagick.com/




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



Re: [PHP] Ok next php problem

2006-06-18 Thread Chris

Rob W. wrote:

I got the previous question answered, Now here's my next problem.

With the numbers displaying correctly again I got:

1
2
3
4
5
6
7
10
11
12
13
14
15
16
17
18
19
20
21
22
25

listed in that order in the database

Now i'm trying to figure out how to write a syntax saying that if like number 8 
isnt listed, display it.


Get them both into arrays and compare:

$good_list = range(1,10);
$db_list = array(4,7,10);

$missing = array_diff($good_list, $db_list);

http://php.net/array_diff

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Ok, why is this happening...

2005-07-22 Thread Richard Lynch
On Tue, July 19, 2005 10:26 am, John Nichel said:

> There's some freaky math going on there or something.  I added a couple
> of other echos in to see and for some reason it seems to be losing
> single digit value (subtracting, rounding down, I don't know).
>
> $calculatedGross  = $originalNet + ( $originalNet * $commissionPct * 0.01
> );
>
> echo ( "Gross : " . (int)$calculatedGross ." = ". $originalNet ." + ( ".
> $originalNet ." * ". $commissionPct ." *.01 )\n" );
>
> $calculatedNet= $calculatedGross / ( 1 + ( $commissionPct * 0.01 ));
>
> echo ( "Net : " . (int)$calculatedNet." = " . (int)$calculatedGross . "
> / ( 1 + ( " . $commissionPct . " * .01 ) )\n" );

Floating point mathematics is inherently "unreliable" in computers.

Consider, for example, 1/3 in decimal notation:

1.33...

PHP can only write so many digits down in a 32-bit floating point
representation, just as you can only write down so many digits before your
hand cramps up or you run out of paper or you get lazy and put "..." on
the end. :-)

Now, the thing to remember is, the problem won't appear where you expect
it to from your experience with DECIMAL numbers all your life because
floating point numbers are being stored in a binary/hexidecimal notation.

If you are feeling particularly masochistic, you can Google for "floating
point internal representation mantissa exponent" and you're gonna find out
EXACTLY how those numbers get stored.  Set aside a good chunk of time to
absorb it all... :-)

Even something as simple as:


could, in theory, print out something like:
1.
and be "correct" as far as Computer Science is concerned.

If you need PRECISE mathematics, you should use integer and count pennies
instead of dollars -- or even 1/10th of pennies or whatever resolution you
need.

Of course, every step you take on the right, you can only store 1/10th as
large a number of dollars as your maximum amount.  But you are starting
with 2 billion as your max, so that's a lot of room to play with.

If you *need* float numbers and precision out to decimal point N, look
into BC_MATH and that new-fangled Math package PHP has for this very
reason. You'll still be dealing with this issue, but you'll know your
numbers are accurate to the Nth decimal point, and it will be painfully
obvious in your code that it is so.  [It will also be SLOWER than just
plain float numbers.]

If you just don't care about the damn penny, but want your code to work,
something like:

if (1.00 <= $x && $x <= 1.01){
  // $x == 1, really
}
may suffice for your everyday work-a-day computing needs...

Though that can also turn into a lot more problems than you think, down
the line...

Remember 2nd Grade when long division was "tricky"?  Yeah, well, computers
are a hell of a lot more stupid than 2nd Graders, any day of the week.

Note that there *ARE* computer languages where are prefectly happy to work
in fractions (Lisp is one such language) because somebody has programmed
the algebraic rules of fraction arithmetic into the language:
(let ((x 1/3)
  (y 2/3))
  (print (+ x y))
will cheefully and with 100% accuracy print out "1" every single time.
[Apologies to Guy Steele if my 10-years-unused Lisp syntax is not spot on.]

Lisp stores fractions as 2 integers, not as floating point numbers.
[Though of course you can ask it to convert and round off if you like.]

You could, if you so desired, whip up a PHP "class fraction {" code-base,
or even just store fractions as 2-element arrays (numerator, denominator)
and write some procedural functions to work with them.

It's not exactly Rocket Science to do that.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Ok, why is this happening...

2005-07-19 Thread Andy Pieters
Hi 

I admit not gone trough all of your code, but mostly this happens when mixing 
the string concatenation operator (.) with the addition (+) or substraction 
(-) operator.

HTH

With kind regards

Andy

On Tuesday 19 July 2005 19:26, John Nichel wrote:
> Chris Boget wrote:
> >>Chris Boget wrote:
> >>
> >>
> >>>echo "if( $originalNet != $calculatedNet ) = " . ( (int)$originalNet !==
> >>>(int)$calculatedNet ) . "\n";
> >>
> >>
> >>Change this to echo out what you're comparing...
> >>echo "if( ". (int)$originalNet ." != ". (int)$calculatedNet ." ) = " . (
> >>(int)$originalNet !== (int)$calculatedNet ) . "\n";
> >>That'll show what numbers is actually trying to match.
> >
> > Ok, then that begs the following questions:
> >
> > If I don't cast any of the values, why do they display as being
> > identicle? Additionally, why does every IF check fail in that case?
>
> There's some freaky math going on there or something.  I added a couple
> of other echos in to see and for some reason it seems to be losing
> single digit value (subtracting, rounding down, I don't know).
>
> $calculatedGross  = $originalNet + ( $originalNet * $commissionPct * 0.01
> );
>
> echo ( "Gross : " . (int)$calculatedGross ." = ". $originalNet ." + ( ".
> $originalNet ." * ". $commissionPct ." *.01 )\n" );
>
> $calculatedNet= $calculatedGross / ( 1 + ( $commissionPct * 0.01 ));
>
> echo ( "Net : " . (int)$calculatedNet." = " . (int)$calculatedGross . "
> / ( 1 + ( " . $commissionPct . " * .01 ) )\n" );
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]

-- 
Registered Linux User Number 379093
   Cockroaches and socialites are the only things that can 
   stay up all night and eat anything.
Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C$(+++) UL>$ P-(+)>++
L+++>$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>$@ h++(*) r-->++ y--()>
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--


pgptzLlv5o2r7.pgp
Description: PGP signature


Re: [PHP] Ok, why is this happening...

2005-07-19 Thread John Nichel

Chris Boget wrote:

Chris Boget wrote:



echo "if( $originalNet != $calculatedNet ) = " . ( (int)$originalNet !==
(int)$calculatedNet ) . "\n";



Change this to echo out what you're comparing...
echo "if( ". (int)$originalNet ." != ". (int)$calculatedNet ." ) = " . (
(int)$originalNet !== (int)$calculatedNet ) . "\n";
That'll show what numbers is actually trying to match.



Ok, then that begs the following questions:

If I don't cast any of the values, why do they display as being identicle?
Additionally, why does every IF check fail in that case?


There's some freaky math going on there or something.  I added a couple 
of other echos in to see and for some reason it seems to be losing 
single digit value (subtracting, rounding down, I don't know).


$calculatedGross  = $originalNet + ( $originalNet * $commissionPct * 0.01 );

echo ( "Gross : " . (int)$calculatedGross ." = ". $originalNet ." + ( ".
$originalNet ." * ". $commissionPct ." *.01 )\n" );

$calculatedNet= $calculatedGross / ( 1 + ( $commissionPct * 0.01 ));

echo ( "Net : " . (int)$calculatedNet." = " . (int)$calculatedGross . " 
/ ( 1 + ( " . $commissionPct . " * .01 ) )\n" );


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Ok, why is this happening...

2005-07-19 Thread Chris Boget
> Chris Boget wrote:
> 
> > echo "if( $originalNet != $calculatedNet ) = " . ( (int)$originalNet !==
> > (int)$calculatedNet ) . "\n";
> 
> Change this to echo out what you're comparing...
> echo "if( ". (int)$originalNet ." != ". (int)$calculatedNet ." ) = " . (
> (int)$originalNet !== (int)$calculatedNet ) . "\n";
> That'll show what numbers is actually trying to match.

Ok, then that begs the following questions:

If I don't cast any of the values, why do they display as being identicle?
Additionally, why does every IF check fail in that case?

thnx,
Chris

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



Re: [PHP] Ok, why is this happening...

2005-07-19 Thread John Nichel

Chris Boget wrote:


echo "if( $originalNet != $calculatedNet ) = " . ( (int)$originalNet !==
(int)$calculatedNet ) . "\n";



Change this to echo out what you're comparing...

echo "if( ". (int)$originalNet ." != ". (int)$calculatedNet ." ) = " . ( 
(int)$originalNet !== (int)$calculatedNet ) . "\n";


That'll show what numbers is actually trying to match.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] OK ... WHY does this work ?????

2004-09-15 Thread Gryffyn, Trevor
Read over some of the examples at:
http://us4.php.net/types.array

If you don't set a key, PHP starts with '0' and increments as you add
more elements to the array.

If you have "NOTICEs" turned on, I believe you'll get a notice saying
that $arrlevels[99] doesn't exist.  It's not a fatal error, so PHP just
passes over it and doesn't say anything unless you tell it to.

# One dimensional array
$arrlevels = array(1,2,3);

# Three dimensional array.  $lvl_guest is a key and 'levelname' is a key
$arrlevels[$lvl_guest]['levelname'];

-TG

> On Tue, 14 Sep 2004 22:32:54 +0200, -{ Rene Brehmer }-
> <[EMAIL PROTECTED]> wrote:
> > Unless I misunderstand how PHP make unspecified arrays (and 
> I probably do
> > since this works), when you have an array of 3 elements on the first
> > dimenstion like I do, and then ask for 
> $arrlevels[$lvl_guest]['levelname'],
> > which in this case actually means it asks for 
> $arrlevels[99]['levelname']
> >  how come it pick the correct element, and not error 
> out that element
> > 99 don't exist ??
> > 
> > My only conclusion (based on the fact that this actually 
> works) is that PHP
> > makes the key the same as the value if the key isn't 
> specified. But is this
> > actually correct  Or is there something "going on" that 
> I don't know
> > about ???

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



Re: [PHP] OK ... WHY does this work ?????

2004-09-14 Thread Greg Donald
On Tue, 14 Sep 2004 22:32:54 +0200, -{ Rene Brehmer }-
<[EMAIL PROTECTED]> wrote:
> Unless I misunderstand how PHP make unspecified arrays (and I probably do
> since this works), when you have an array of 3 elements on the first
> dimenstion like I do, and then ask for $arrlevels[$lvl_guest]['levelname'],
> which in this case actually means it asks for $arrlevels[99]['levelname']
>  how come it pick the correct element, and not error out that element
> 99 don't exist ??
> 
> My only conclusion (based on the fact that this actually works) is that PHP
> makes the key the same as the value if the key isn't specified. But is this
> actually correct  Or is there something "going on" that I don't know
> about ???

Yes, that is what's happening, a simple test shows this:

#!/usr/bin/php


output:
Array
(
[0] => 1
[1] => 2
[2] => 3
)


-- 
Greg Donald
http://destiney.com/

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



Re: [PHP] OK SQL experts...

2004-04-25 Thread Daniel Clark
The parenthesis are OK.   The query might take a long time to run with 3 LIKE 
statements.


>>Backticks, single quotes, or nothing at all makes no difference. I 
>>believe the parsing error is due to my parentheses or AND/OR structure. 
>>Any thoughts on that?
>>
>>
>>
>>On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:
>>
>>> From: "Brian Dunning" <[EMAIL PROTECTED]>
>>>
 I STFW and RTFM and I still can't figure out why this returns a 1064
 parse error:

 SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
 'status' = 'active';




Re: [PHP] OK SQL experts...

2004-04-25 Thread Daniel Clark
I think you want to remove the single quotes around the field names.

SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%' OR 
field_2 LIKE '%$keyword%' OR field_3 LIKE '%$keyword%') AND 
status = 'active';


>>I STFW and RTFM and I still can't figure out why this returns a 1064 
>>parse error:
>>
>>SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
>>'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
>>'status' = 'active';
>>
>>Anyone? TIA!
>>
>>- B1ff Lamer

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread John Nichel
Brian Dunning wrote:
On Apr 23, 2004, at 10:13 AM, John Nichel wrote:

Brian Dunning wrote:

I STFW and RTFM and I still can't figure out why this returns a 1064 
parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
'status' = 'active';
Anyone? TIA!
- B1ff Lamer


What does mysql_error() tell you?


You have an error in your SQL syntax. Check the manual that corresponds 
to your MySQL server version for the right syntax to use near 
''my_table' WHERE ('field_1' LIKE '%%' OR 'field2'

I think this has been mentioned already, but your field names shouldn't 
have quotes around them.  You should be using back ticks.

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
You have an error in your SQL syntax. Check the manual that 
corresponds
to your MySQL server version for the right syntax to use near
''my_table' WHERE ('field_1' LIKE '%%' OR 'field2'
Because you are using a single quotes around  your table/field
names. Remove them or use ` (back tick). As suggested earlier.
NOW IT WORKS!! I thought I had tried back ticks and nothing - I did try 
it, must have made a typo. But all is well now. THANKS VERY MUCH

- B1ff Lamer

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


Re: [PHP] OK SQL experts...

2004-04-23 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]>
> My error. Here is the actual return:
>
> You have an error in your SQL syntax. Check the manual that corresponds
> to your MySQL server version for the right syntax to use near
> ''my_table' WHERE ('field_1' LIKE '%custom%' OR 'field_
>
> I am searching for the word "custom," which I put in at least one of
> the fields in several records, so the search SHOULD find something.

Take out the single quotes around your table name! If you must, use
backticks, but even they aren't necessary. Then tell us what the new error
is.

---John Holmes...

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
You have an error in your SQL syntax. Check the manual that 
corresponds
to your MySQL server version for the right syntax to use near
''my_table' WHERE ('field_1' LIKE '%%' OR 'field2'
Because you are using a single quotes around  your table/field
names. Remove them or use ` (back tick). As suggested earlier.
NOW IT WORKS!! I thought I had tried back ticks and nothing - I did try 
it, must have made a typo. But all is well now. THANKS VERY MUCH

- B1ff Lamer

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


Re: [PHP] OK SQL experts...

2004-04-23 Thread Curt Zirzow
* Thus wrote Brian Dunning ([EMAIL PROTECTED]):
> 
> On Apr 23, 2004, at 10:13 AM, John Nichel wrote:
> 
> >Brian Dunning wrote:
> >>I STFW and RTFM and I still can't figure out why this returns a 1064 
> >>parse error:
> >>SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
> >>'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
> >>'status' = 'active';
> >>Anyone? TIA!
> >>- B1ff Lamer
> >
> >What does mysql_error() tell you?
> 
> You have an error in your SQL syntax. Check the manual that corresponds 
> to your MySQL server version for the right syntax to use near 
> ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2'

Because you are using a single quotes around  your table/field
names. Remove them or use ` (back tick). As suggested earlier.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
On Apr 23, 2004, at 10:27 AM, Edward Peloke wrote:

doesn't look like your $keyword value contains anything.
My error. Here is the actual return:

You have an error in your SQL syntax. Check the manual that corresponds 
to your MySQL server version for the right syntax to use near 
''my_table' WHERE ('field_1' LIKE '%custom%' OR 'field_

I am searching for the word "custom," which I put in at least one of 
the fields in several records, so the search SHOULD find something.

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


RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
doesn't look like your $keyword value contains anything.

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 1:19 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...



On Apr 23, 2004, at 10:13 AM, John Nichel wrote:

> Brian Dunning wrote:
>> I STFW and RTFM and I still can't figure out why this returns a 1064 
>> parse error:
>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
>> 'status' = 'active';
>> Anyone? TIA!
>> - B1ff Lamer
>
> What does mysql_error() tell you?

You have an error in your SQL syntax. Check the manual that corresponds 
to your MySQL server version for the right syntax to use near 
''my_table' WHERE ('field_1' LIKE '%%' OR 'field2'

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

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
On Apr 23, 2004, at 10:13 AM, John Nichel wrote:

Brian Dunning wrote:
I STFW and RTFM and I still can't figure out why this returns a 1064 
parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
'status' = 'active';
Anyone? TIA!
- B1ff Lamer
What does mysql_error() tell you?
You have an error in your SQL syntax. Check the manual that corresponds 
to your MySQL server version for the right syntax to use near 
''my_table' WHERE ('field_1' LIKE '%%' OR 'field2'

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


Re: [PHP] OK SQL experts...

2004-04-23 Thread John Nichel
Brian Dunning wrote:
I STFW and RTFM and I still can't figure out why this returns a 1064 
parse error:

SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' 
LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active';

Anyone? TIA!

- B1ff Lamer

What does mysql_error() tell you?

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] OK SQL experts...

2004-04-23 Thread Curt Zirzow
* Thus wrote Brian Dunning ([EMAIL PROTECTED]):
> I STFW and RTFM and I still can't figure out why this returns a 1064 
> parse error:
> 
> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
> 'status' = 'active';

You might want to change your subject to 'mind reading experts'.  A
lot of things can be wrong with this, as per the whole discussion
on this topic has shown.

All you need to do is echo mysql_error() and echo the actual string
that you are passing to mysql_query(). You're problem will be
solved rather quickly if you do that.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread William Lovaton
How are you manipulating the whole SQL string?? 

$sql = "SELECT..."; ???

or 

$sql = 'SELECT...'; ???

In this case you will have to use double quotes because PHP won't parse
single quote strings for searching embedded PHP variables.

May be this is the problem.


-William


El vie, 23-04-2004 a las 11:02, Brian Dunning escribió:
> > if that works move up into:
> > SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status =
> > 'active';
> 
> Yes, I actually did exactly that. Everything works until I have more 
> than one statement inside the (x LIKE x OR x LIKE x) parens. That's why 
> I figured there has to be something wrong with my paren structure. When 
> I RTFM I saw someplace to use {}+ instead of () but it gave a different 
> error.

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
if that works move up into:
SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status =
'active';
Yes, I actually did exactly that. Everything works until I have more 
than one statement inside the (x LIKE x OR x LIKE x) parens. That's why 
I figured there has to be something wrong with my paren structure. When 
I RTFM I saw someplace to use {}+ instead of () but it gave a different 
error.

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


RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip]
SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status =
'active';

if that works continue until you get an error.
[/snip]

That'll give you an error right there. That old single quoted variable
will get you every time. :)

WHERE (field_1 LIKE '%$keyword%') 

WHERE (field_1 LIKE '%" . $keyword . "%') 

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



RE: [PHP] OK SQL experts...

2004-04-23 Thread Chris W. Parker
Brian Dunning 
on Friday, April 23, 2004 8:19 AM said:

> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
> 'status' = 'active';

have you tried simply:

SELECT * FROM my_table WHERE status = 'active';

??

if that works move up into:

SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status =
'active';

if that works continue until you get an error.



chris.

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
I don't have access to the MySQL command line; it's hosted at my ISP.

:(

On Apr 23, 2004, at 8:54 AM, Mark wrote:

--- Brian Dunning <[EMAIL PROTECTED]> wrote:
Yes, I've checked and rechecked the spelling on everything. I've
been
testing with a word that I know appears in at least one of the
fields.
I'm coming in a bit late, but have you tried echoing out the query
variable contents and copying and pasting that to the MySQL command
line?
Also, any chance you could post the table decription?

On Apr 23, 2004, at 8:54 AM, Edward Peloke wrote:

what value is being put in the $keyword variable?  You are sure
all
these
columns exist?
-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...
Backticks, single quotes, or nothing at all makes no difference.
I
believe the parsing error is due to my parentheses or AND/OR
structure.
Any thoughts on that?



On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:

From: "Brian Dunning" <[EMAIL PROTECTED]>

I STFW and RTFM and I still can't figure out why this returns a
1064
parse error:

SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
'status' = 'active';
Use backticks around table and column names, not single quotes.

---John Holmes...

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

- Brian

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

- Brian

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


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to 
fight to death to defend everyone else's right to the same thing.
***



__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

- Brian

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


RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip]
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
'status' = 'active';
[/snip]

*slaps forehead*

"SELECT * FROM my_table WHERE (field_1 LIKE '%" . $keyword . "%' OR 
field_2 LIKE '%" . $keyword . "%' OR field_3 LIKE '%" . $keyword . "%')
AND 
status = 'active'";

The single quoted variables do not get parsed

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



RE: [PHP] OK SQL experts...

2004-04-23 Thread Daniel Purdy
>>> I STFW and RTFM and I still can't figure out why this returns a 1064

>>> parse error:
>>>
>>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
>>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
>>> 'status' = 'active';

Why don't you try rebuilding the query. I mean go into phpmyadmin and
issue select * from `my_table` if that works. Then add on one where
clause
Select * FROM `my_table` WHERE (`field_1 LIKE '%key%' )  , and just put
it back together piece by piece until it breaks. That should at least
help narrow down what is breaking.

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Mark

--- Brian Dunning <[EMAIL PROTECTED]> wrote:
> Yes, I've checked and rechecked the spelling on everything. I've
> been 
> testing with a word that I know appears in at least one of the
> fields.
> 

I'm coming in a bit late, but have you tried echoing out the query
variable contents and copying and pasting that to the MySQL command
line?

Also, any chance you could post the table decription? 

> 
> On Apr 23, 2004, at 8:54 AM, Edward Peloke wrote:
> 
> > what value is being put in the $keyword variable?  You are sure
> all 
> > these
> > columns exist?
> >
> > -Original Message-
> > From: Brian Dunning [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 23, 2004 11:36 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] OK SQL experts...
> >
> >
> > Backticks, single quotes, or nothing at all makes no difference.
> I
> > believe the parsing error is due to my parentheses or AND/OR
> structure.
> > Any thoughts on that?
> >
> >
> >
> > On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:
> >
> >> From: "Brian Dunning" <[EMAIL PROTECTED]>
> >>
> >>> I STFW and RTFM and I still can't figure out why this returns a
> 1064
> >>> parse error:
> >>>
> >>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
> >>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
> >>> 'status' = 'active';
> >>
> >> Use backticks around table and column names, not single quotes.
> >>
> >> ---John Holmes...
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> > - Brian
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> - Brian
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***




__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
phpmyadmin echoes it out exactly as I copied & pasted into my first 
post.

On Apr 23, 2004, at 8:56 AM, Edward Peloke wrote:

if you echo out the query..what is the output?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...
Backticks, single quotes, or nothing at all makes no difference. I
believe the parsing error is due to my parentheses or AND/OR structure.
Any thoughts on that?


On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:

From: "Brian Dunning" <[EMAIL PROTECTED]>

I STFW and RTFM and I still can't figure out why this returns a 1064
parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
'status' = 'active';
Use backticks around table and column names, not single quotes.

---John Holmes...

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

- Brian

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

- Brian

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


Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
Yes, I've checked and rechecked the spelling on everything. I've been 
testing with a word that I know appears in at least one of the fields.

On Apr 23, 2004, at 8:54 AM, Edward Peloke wrote:

what value is being put in the $keyword variable?  You are sure all 
these
columns exist?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...
Backticks, single quotes, or nothing at all makes no difference. I
believe the parsing error is due to my parentheses or AND/OR structure.
Any thoughts on that?


On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:

From: "Brian Dunning" <[EMAIL PROTECTED]>

I STFW and RTFM and I still can't figure out why this returns a 1064
parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
'status' = 'active';
Use backticks around table and column names, not single quotes.

---John Holmes...

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

- Brian

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

- Brian

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


RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
if you echo out the query..what is the output?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...


Backticks, single quotes, or nothing at all makes no difference. I 
believe the parsing error is due to my parentheses or AND/OR structure. 
Any thoughts on that?



On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:

> From: "Brian Dunning" <[EMAIL PROTECTED]>
>
>> I STFW and RTFM and I still can't figure out why this returns a 1064
>> parse error:
>>
>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
>> 'status' = 'active';
>
> Use backticks around table and column names, not single quotes.
>
> ---John Holmes...
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
- Brian

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

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



RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
what value is being put in the $keyword variable?  You are sure all these
columns exist?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...


Backticks, single quotes, or nothing at all makes no difference. I
believe the parsing error is due to my parentheses or AND/OR structure.
Any thoughts on that?



On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:

> From: "Brian Dunning" <[EMAIL PROTECTED]>
>
>> I STFW and RTFM and I still can't figure out why this returns a 1064
>> parse error:
>>
>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
>> 'status' = 'active';
>
> Use backticks around table and column names, not single quotes.
>
> ---John Holmes...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
- Brian

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

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



RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip]
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
'status' = 'active';
[/snip]

How about this?

SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%' OR 
field_2 LIKE '%$keyword%' OR field_3 LIKE '%$keyword%') AND 
status = 'active';

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



RE: [PHP] OK SQL experts...

2004-04-23 Thread Jeff McKeon
> >> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
> >> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
> >> 'status' = 'active';

Longshot but try to remove the ' ' from around the field names in the
where statement..

Or 

SELECT * FROM My_Table
WHERE field_1 like '%$keyword%' && status = 'active'
|| field_2 like '%$keyword%' && status = 'active'
|| field_3 like '%$keyword%' && status = 'active'

Jeff

> -Original Message-
> From: Brian Dunning [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 23, 2004 11:30 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] OK SQL experts...
> 
> 
> It gives the same error when I run it in phpmyadmin.
> 
> 
> On Apr 23, 2004, at 8:34 AM, Edward Peloke wrote:
> 
> > does it just return the error when running in the php page?  If you
> > pull it
> > out can you run it in mysql without errors?
> >
> > -Original Message-
> > From: Brian Dunning [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 23, 2004 11:23 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] OK SQL experts...
> >
> >
> > I tried it both ways - didn't make any difference 
> (phpmyadmin adds the 
> > single quotes when I was trying to use its sql function to 
> debug, so I 
> > figured what the hell)...
> >
> >
> > On Apr 23, 2004, at 8:27 AM, Edward Peloke wrote:
> >
> >> why are the table and field names surrounded by single quotes?
> >>
> >> -Original Message-
> >> From: Brian Dunning [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, April 23, 2004 11:19 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP] OK SQL experts...
> >>
> >>
> >> I STFW and RTFM and I still can't figure out why this 
> returns a 1064 
> >> parse error:
> >>
> >> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
> >> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
> >> 'status' = 'active';
> >>
> >> Anyone? TIA!
> >>
> >> - B1ff Lamer
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> > - Brian
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> - Brian
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
Backticks, single quotes, or nothing at all makes no difference. I 
believe the parsing error is due to my parentheses or AND/OR structure. 
Any thoughts on that?



On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:

From: "Brian Dunning" <[EMAIL PROTECTED]>

I STFW and RTFM and I still can't figure out why this returns a 1064
parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
'status' = 'active';
Use backticks around table and column names, not single quotes.

---John Holmes...

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

- Brian

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


Re: [PHP] OK SQL experts...

2004-04-23 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]>

> I STFW and RTFM and I still can't figure out why this returns a 1064 
> parse error:
> 
> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
> 'status' = 'active';

Use backticks around table and column names, not single quotes. 

---John Holmes...

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Richard Harb
AFAIK phpMyAdmin uses backticks for table/field names, not single
quotes ...


Friday, April 23, 2004, 5:22:35 PM, thus was written:
> I tried it both ways - didn't make any difference (phpmyadmin adds the
> single quotes when I was trying to use its sql function to debug, so I
> figured what the hell)...


> On Apr 23, 2004, at 8:27 AM, Edward Peloke wrote:

>> why are the table and field names surrounded by single quotes?
>>
>> -Original Message-
>> From: Brian Dunning [mailto:[EMAIL PROTECTED]
>> Sent: Friday, April 23, 2004 11:19 AM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] OK SQL experts...
>>
>>
>> I STFW and RTFM and I still can't figure out why this returns a 1064
>> parse error:
>>
>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
>> 'status' = 'active';
>>
>> Anyone? TIA!
>>
>> - B1ff Lamer
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
> - Brian

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
It gives the same error when I run it in phpmyadmin.

On Apr 23, 2004, at 8:34 AM, Edward Peloke wrote:

does it just return the error when running in the php page?  If you 
pull it
out can you run it in mysql without errors?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:23 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...
I tried it both ways - didn't make any difference (phpmyadmin adds the
single quotes when I was trying to use its sql function to debug, so I
figured what the hell)...
On Apr 23, 2004, at 8:27 AM, Edward Peloke wrote:

why are the table and field names surrounded by single quotes?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] OK SQL experts...
I STFW and RTFM and I still can't figure out why this returns a 1064
parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
'status' = 'active';
Anyone? TIA!

- B1ff Lamer

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


- Brian

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

- Brian

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


RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
does it just return the error when running in the php page?  If you pull it
out can you run it in mysql without errors?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:23 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] OK SQL experts...


I tried it both ways - didn't make any difference (phpmyadmin adds the
single quotes when I was trying to use its sql function to debug, so I
figured what the hell)...


On Apr 23, 2004, at 8:27 AM, Edward Peloke wrote:

> why are the table and field names surrounded by single quotes?
>
> -Original Message-
> From: Brian Dunning [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 23, 2004 11:19 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] OK SQL experts...
>
>
> I STFW and RTFM and I still can't figure out why this returns a 1064
> parse error:
>
> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
> 'status' = 'active';
>
> Anyone? TIA!
>
> - B1ff Lamer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
- Brian

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

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



RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip]
I tried it both ways - didn't make any difference (phpmyadmin adds the 
single quotes when I was trying to use its sql function to debug, so I 
figured what the hell)...
[/snip]

Those aren't single quotes it adds to table and column names...those are
back tics (on the same key as the tilde) If you chnage those you should
be OK.

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



Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
I tried it both ways - didn't make any difference (phpmyadmin adds the 
single quotes when I was trying to use its sql function to debug, so I 
figured what the hell)...

On Apr 23, 2004, at 8:27 AM, Edward Peloke wrote:

why are the table and field names surrounded by single quotes?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] OK SQL experts...
I STFW and RTFM and I still can't figure out why this returns a 1064
parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
'status' = 'active';
Anyone? TIA!

- B1ff Lamer

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


- Brian

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


RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
why are the table and field names surrounded by single quotes?

-Original Message-
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 11:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] OK SQL experts...


I STFW and RTFM and I still can't figure out why this returns a 1064 
parse error:

SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
'status' = 'active';

Anyone? TIA!

- B1ff Lamer

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

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



Re: [PHP] OK

2003-07-22 Thread Jeff Harris
On Jul 22, 2003, "Rausch Alexandru" claimed that:

|Sorry, i didn't itent to be a spam, believe me. But i don't know how to
|do this aplication
|

In that case, you might want to start with something a bit less ambitious,
maybe learning to wrap your mail, and some tutorials?
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_1/page1.html

Maybe a web search to see if what you want to do has already been done?

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] OK, So I am new to these List. Win2000 help!

2003-07-13 Thread John Nichel
John A. Thomason wrote:
Thanks, that did it. And yes, I am trying to run this as a shell script.
Thank you very much.
John.

- Original Message - 
From: "John Nichel" <[EMAIL PROTECTED]>
To: "John A. Thomason" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 12, 2003 10:01 PM
Subject: Re: [PHP] OK, So I am new to these List. Win2000 help!



John A. Thomason wrote:

The following is my output in the command prompt window(DOS Prompt?)

C:\PHP>hello.php
Content-type: text/html
X-Powered-By: PHP/4.3.2
!#C:\php\;
echo"Hello World!";
if ($foo):
echo "yep\n";
elseif ($bar):
echo "almost\n";
else:
echo "nope\n";
endif;
phpinfo();
C:\PHP>
And the following is the PHP code to generate it.

!#C:\php\;

echo"Hello World!";

if ($foo):

echo "yep\n";

elseif ($bar):

echo "almost\n";

else:

echo "nope\n";

endif;

phpinfo();

Now, I know that the variables are not set, so they should be false, but

the

output just displays a "listing" of the code and doesn't process it. In

the

documentation, it states that PHP can be run from the command prompt,

like a

batch file. Now what am I doing wrong.

I do have it working correctly with an Apache server, that I am using
backend.
and my install dir is "C:\php", and it is listed first in the path.

John A. Thomason

[EMAIL PROTECTED]

Looks like you're trying to run it as a shell script, or a cgi program.
 Replace the sh-bang on the first line with 
eg:


Yeah, you just need to enclose the actual script in the opening/closing 
php tags ().  And to run it as a shell script, you can 
either call the script as...

c:\path\to\php\php.exe filename.php (or just 'php filename.php' if the 
php interperter is in your path), or put the sh-bang as the first line 
(before the opening php tag).

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


Re: [PHP] OK, So I am new to these List. Win2000 help!

2003-07-12 Thread John Nichel
John A. Thomason wrote:
The following is my output in the command prompt window(DOS Prompt?)

C:\PHP>hello.php
Content-type: text/html
X-Powered-By: PHP/4.3.2
!#C:\php\;
echo"Hello World!";
if ($foo):
echo "yep\n";
elseif ($bar):
echo "almost\n";
else:
echo "nope\n";
endif;
phpinfo();
C:\PHP>
And the following is the PHP code to generate it.

!#C:\php\;

echo"Hello World!";

if ($foo):

echo "yep\n";

elseif ($bar):

echo "almost\n";

else:

echo "nope\n";

endif;

phpinfo();

Now, I know that the variables are not set, so they should be false, but the
output just displays a "listing" of the code and doesn't process it. In the
documentation, it states that PHP can be run from the command prompt, like a
batch file. Now what am I doing wrong.
I do have it working correctly with an Apache server, that I am using
backend.
and my install dir is "C:\php", and it is listed first in the path.

John A. Thomason

[EMAIL PROTECTED]

Looks like you're trying to run it as a shell script, or a cgi program. 
 Replace the sh-bang on the first line with 

eg:


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


Re: [PHP] OK guys, thank you so far

2003-06-04 Thread Lars Torben Wilson
On Tue, 2003-06-03 at 13:20, David Nicholson wrote:
> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 3 Jun 2003 at 20:04,
> lines prefixed by '>' were originally written by you.
> > I've tried and here's the output:
> > Undefined index: input
> > if ($HTTP_GET_VARS['printout'] != "yeah") { include("header.php"); }
> 
> You have error reporting set to E_ALL, turn it down a bit.
> 
> More information at:
> http://uk2.php.net/error_reporting
> 
> David.

This is a good idea for a production machine, but for your development
environment, turning down error reporting is not a good idea. :) You 
will kill yourself trying to track down subtle errors when they aren't
displayed.

Try checking your variables before using them:

 if (isset($_GET['printout']) && $_GET['printout'] != 'yeah') { 
// . . .
 }



Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



Re: [PHP] OK guys, thank you so far

2003-06-04 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Tue, 3 Jun 2003 at 20:04,
lines prefixed by '>' were originally written by you.
> I've tried and here's the output:
> Undefined index: input
> if ($HTTP_GET_VARS['printout'] != "yeah") { include("header.php"); }

You have error reporting set to E_ALL, turn it down a bit.

More information at:
http://uk2.php.net/error_reporting

David.

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



Re: [PHP] OK guys, thank you so far

2003-06-04 Thread Øystein Håland
I've tried and here's the output:
Undefined index: input

if ($HTTP_GET_VARS['printout'] != "yeah") { include("header.php"); }

"Edward Peloke" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> can you try if ($HTTP_GET_VARS['printout']!="yeah")
{include("header.php");}
>
> does that work?
>
> -Original Message-
> From: Øystein Håland [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 03, 2003 1:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] OK guys, thank you so far
>
>
> Now my code is
>
> extract ($_GET);
> if ($_GET['printout'] != "yeah") { include("header.php"); }
>
> but I still get the following error:
>
> Undefined index: printout
>
> I understand nothing
>
> "Jonathan Wilkes" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> Hi,
>
> What he means is that with "register_globals=off" you cannot do this:
>
> echo $path
>
> you need to do this (if the variable is sent by "POST" action)
>
> echo _POST('path')
>
> and through "GET"
>
> echo _GET('path')
>
> -Original Message-
> From: Øystein Håland [mailto:[EMAIL PROTECTED]
> Sent: 03 June 2003 17:02
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Migration from register_globals=on to
> register_globals=off
>
>
> I'm not sure what you mean. To give ONE example:
> Earlier I could use this code on top of every page:
> if  ($printout != "yeah") { include("header.php"); }
> This code gives an error today. The variable $printout is set if the
visitor
> choose to click on the 'print_page_image', otherwise the variable has no
> value.
>
> "Esteban FernáNdez" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> > When you recivied that error ?, in a form ?, if is in a Form just put in
> the
> > top of .php files this code
> >
> > $HTTP_GET_VARS["variable2"];
> > $HTTP_GET_VARS["variable3"];
> >
> > Of course if you send with other method (post) change the GET for POST
> >
> > $HTTP_POS_VARS["variable2"];
> > $HTTP_POS_VARS["variable3"];
> >
> > Regards.
> >
> > Esteban.
> >
> >
> >
> > "ØYstein HåLand" <[EMAIL PROTECTED]> escribió en el mensaje
> > news:[EMAIL PROTECTED]
> > > None of my old scripts worx nowadays and the most common error message
> is
> > > 'undefined variable'. What is the best/simplest way to work around
this
> > > situation?
> > > if !isset($myvar) {
> > > do this
> > > blah blah
> > > }
> > > ?
> > >
> > >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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



Re: [PHP] OK guys, thank you so far

2003-06-04 Thread Wendell Brown
On Tue, 3 Jun 2003 19:16:30 +0200, +ystein H†land wrote:

>Now my code is
>
>extract ($_GET);
>if ($_GET['printout'] != "yeah") { include("header.php"); }
>
>but I still get the following error:
>
>Undefined index: printout
>
>I understand nothing

Ok, it looks like you are mixing your metaphors ;)

If you use extract( $_GET ); -- you should have a $printout variable
available (assuming you aren't doing a POST form and you are on a
version of PHP that supports $_GET).  At least two of the following
should work...

--- Option 1 --- GET method - New PHP
 
extract($_GET);
if ($printout != "yeah") { include("header.php"); }

--- Option 2 --- POST method - New PHP 

extract($_POST);
if ($printout != "yeah") { include("header.php"); }

--- Option 3 --- GET method - Older PHP

extract($HTTP_GET_VARS);
if ($printout != "yeah") { include("header.php"); }

--- Option 4 --- POST method - Older PHP

extract($HTTP_POST_VARS);
if ($printout != "yeah") { include("header.php"); }

--- Option 5 --- GET method - new php - No extract

if ( $_GET[ 'printout' ] != "yeah") { include("header.php"); }

--- Option 6 --- POST method - new php - No extract

if ( $_POST[ 'printout' ] != "yeah") { include("header.php"); }

--- Option 7 --- GET method - older php - No extract

if ( $HTTP_GET_VARS[ 'printout' ] != "yeah") { include("header.php"); }

--- Option 8 --- POST method - older php - No extract

if ( $HTTP_POST_VARS[ 'printout' ] != "yeah") { include("header.php");
}

 End ---




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



RE: [PHP] OK guys, thank you so far

2003-06-04 Thread Edward Peloke
can you try if ($HTTP_GET_VARS['printout']!="yeah") {include("header.php");}

does that work?

-Original Message-
From: Øystein Håland [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 1:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] OK guys, thank you so far


Now my code is

extract ($_GET);
if ($_GET['printout'] != "yeah") { include("header.php"); }

but I still get the following error:

Undefined index: printout

I understand nothing

"Jonathan Wilkes" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
Hi,

What he means is that with "register_globals=off" you cannot do this:

echo $path

you need to do this (if the variable is sent by "POST" action)

echo _POST('path')

and through "GET"

echo _GET('path')

-Original Message-
From: Øystein Håland [mailto:[EMAIL PROTECTED]
Sent: 03 June 2003 17:02
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Migration from register_globals=on to
register_globals=off


I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if  ($printout != "yeah") { include("header.php"); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.

"Esteban FernáNdez" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> When you recivied that error ?, in a form ?, if is in a Form just put in
the
> top of .php files this code
>
> $HTTP_GET_VARS["variable2"];
> $HTTP_GET_VARS["variable3"];
>
> Of course if you send with other method (post) change the GET for POST
>
> $HTTP_POS_VARS["variable2"];
> $HTTP_POS_VARS["variable3"];
>
> Regards.
>
> Esteban.
>
>
>
> "ØYstein HåLand" <[EMAIL PROTECTED]> escribió en el mensaje
> news:[EMAIL PROTECTED]
> > None of my old scripts worx nowadays and the most common error message
is
> > 'undefined variable'. What is the best/simplest way to work around this
> > situation?
> > if !isset($myvar) {
> > do this
> > blah blah
> > }
> > ?
> >
> >
>
>



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



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


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



Re: [PHP] Ok, problem found, but that makes way for another...

2003-04-03 Thread Ryan Vennell
ok, now where in that heck can i find the php entry in that file?  i cant seem to find 
it anywhere.  would it be with the CGI entry or in a different place?

>>> Marek Kilimajer<[EMAIL PROTECTED]> 04/03/03 04:37AM >>>
The old installation is likely in /usr, and you installed in /usr/local. 
Simply remove the old installation (man rm ;-) and change httpd.conf  to 
look for php in the new place

Ryan Vennell wrote:

>ok, my last post stated that i've tried reconfigureing.making/makeinstalling php 
>4.3.1 a tons of times.  well, today when i typed php -v it told me that version 4.2.2 
>was the one that was installed.  so apparently my installing has not been taking the 
>place of the old one.  
>
>The original root is that the original compile of php (not done by me) was installed 
>w/out mysql and i need mysql for what i'm working on.
>
>now that i know the problem here, any suggestions?
>
>I'm running apache for what i'm working on, tomcat for other things that this server 
>does, and the latest version of mysql
>
>now how do i get rid of hte old php and make sure this new one goes into its place?
>
>P.S.- i'm not a total linux newb but i'm not, NOT a newb either.
>
>  
>




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



Re: [PHP] Ok, problem found, but that makes way for another...

2003-04-03 Thread Marek Kilimajer
The old installation is likely in /usr, and you installed in /usr/local. 
Simply remove the old installation (man rm ;-) and change httpd.conf  to 
look for php in the new place

Ryan Vennell wrote:

ok, my last post stated that i've tried reconfigureing.making/makeinstalling php 4.3.1 a tons of times.  well, today when i typed php -v it told me that version 4.2.2 was the one that was installed.  so apparently my installing has not been taking the place of the old one.  

The original root is that the original compile of php (not done by me) was installed w/out mysql and i need mysql for what i'm working on.

now that i know the problem here, any suggestions?

I'm running apache for what i'm working on, tomcat for other things that this server does, and the latest version of mysql

now how do i get rid of hte old php and make sure this new one goes into its place?

P.S.- i'm not a total linux newb but i'm not, NOT a newb either.

 



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


Re: [PHP] ok now my sessions are *not* timing out

2003-03-11 Thread Ernest E Vogelsinger
At 14:38 11.03.2003, freaky deaky said:
[snip]
>the js looks like: 
> 
>

RE: [PHP] *OK, more eval for today

2002-12-19 Thread Ford, Mike [LSS]
> -Original Message-
> From: Alexey Lysenkov [mailto:[EMAIL PROTECTED]]
> Sent: 18 December 2002 19:08
> 
> 
> I am trying to do this:
> 
> $tempVar1 = '\$HTTP_POST_VARS[\"q4_'.$i.'"]';
>   eval("\$tempVar1=\"$tempVar1\";");
> 

Well, you have the answer right there in front of you -- why not just take the 
statement you build and eval(), and write it directly in the PHP thus:

   $tempVar1 = $HTTP_POST_VARS['q4_'.$i];

or

   $tempVar1 = $HTTP_POST_VARS["q4_$i"];

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




RE: [PHP] *OK, more eval for today

2002-12-18 Thread Martin Towell
argh! eval()
try this instead: $temp = ${"php_q3_$i"};
to get it directly from $HTTP_POST_VARS: $temp =
$HTTP_POST_VARS["php_q3_$i"];
simple

HTH
Martin

-Original Message-
From: Alexey Lysenkov [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 6:08 AM
To: [EMAIL PROTECTED]
Subject: [PHP] *OK, more eval for today


I know, it's eval = evil, but I don't see any other way I can check for 120
variables submitted via post, without making a temp variable, assigning a
value of the posted Var and checking for it (and deciding on the further run
of the script). Anyways, I took a classical eval thing and am doing fine
with it. It looks like this:

$temp = "\$php_q3_".$i; // $i is a loop index
eval ("\$temp = \"$temp\";");

works alright. Now, how do I eval directly from the $HTTP_POST_VARS?

I am trying to do this:

$tempVar1 = '\$HTTP_POST_VARS[\"q4_'.$i.'"]';
  eval("\$tempVar1=\"$tempVar1\";");

and am obviously failing. If you know any other way to validate 120-150
variables in a loop and then rewrite the values into the fields (checkboxes,
radios and selects) - should an error had been made - let me know.

Best Regards,
Alex

p.s. you do help! :)

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




Re: [PHP] *OK, more eval for today

2002-12-18 Thread Alexey Lysenkov
It worked for validation! :) Hooray.
Now, I guess, I have to set the same logic for the whole other bumch of
questions God..
Most probably will post here today later again.

Cheers, John!

-Alex



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




Re: [PHP] *OK, more eval for today

2002-12-18 Thread Alexey Lysenkov
am trying



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




RE: [PHP] *OK, more eval for today

2002-12-18 Thread John W. Holmes
> Okay, wait.
> How?
> 
> say, I have a field of checkboxes in 3 columns and 6 rows. I need at
least
> one checked.
> At the moment every checkbox has the name of kind: q3_4_1 , where 4
stands
> for row and 1 for column. Now, how do I name them and loop through
them?
> Plus, if $HTTP_POST_VAR["q3_4_1"] wasn't checked at all, the value is
not
> passed over, right? So I get... null, I believe. So with my eval I
first
> do
> if(isset()) and then go on. How would I I behave in your case?
> Please, John, if you could be even more specific?
> 
> Sweating Alex

Well, you could do it exactly the same way, but with arrays. 

The same way that you name it "q3_4_1", you'd name your elements exactly
like "q3[4][1]", which will give you a $HTTP_POST_VARS['q3'][4][1]
variable. So you just loop through that array and see what's set and
what isn't. It depends on what you do if the are set or not, but you can
do something like this. I'm going to use $_POST for simplicity.

//$_POST['q3']['row']['column'] (reference)
for($row = 0;$row < 6; $row++)
{
  for($col = 0; $col < 3; $col++)
  {
if(isset($_POST['q3'][$row][$col]))
{ echo "Checkbox row: $row, column: $col was checked"; }
else
{ echo "Checkbox row: $row, column: $col was not checked"; }
  }
}

Untesteed, but that should work.

---John Holmes...



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




Re: [PHP] *OK, more eval for today

2002-12-18 Thread Alexey Lysenkov
Okay, wait.
How?

say, I have a field of checkboxes in 3 columns and 6 rows. I need at least
one checked.
At the moment every checkbox has the name of kind: q3_4_1 , where 4 stands
for row and 1 for column. Now, how do I name them and loop through them?
Plus, if $HTTP_POST_VAR["q3_4_1"] wasn't checked at all, the value is not
passed over, right? So I get... null, I believe. So with my eval I first do
if(isset()) and then go on. How would I I behave in your case?
Please, John, if you could be even more specific?

Sweating Alex


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
001e01c2a6ca$22310e00$7c02a8c0@coconut">news:001e01c2a6ca$22310e00$7c02a8c0@coconut...
> Why not name your form elements php_q3[] and then just loop through the
> array. That would cut the need for eval().
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
> > -Original Message-
> > From: Alexey Lysenkov [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, December 18, 2002 2:08 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] *OK, more eval for today
> >
> > I know, it's eval = evil, but I don't see any other way I can check
> for
> > 120 variables submitted via post, without making a temp variable,
> > assigning a value of the posted Var and checking for it (and deciding
> on
> > the further run of the script). Anyways, I took a classical eval thing
> and
> > am doing fine with it. It looks like this:
> >
> > $temp = "\$php_q3_".$i; // $i is a loop index
> > eval ("\$temp = \"$temp\";");
> >
> > works alright. Now, how do I eval directly from the $HTTP_POST_VARS?
> >
> > I am trying to do this:
> >
> > $tempVar1 = '\$HTTP_POST_VARS[\"q4_'.$i.'"]';
> >   eval("\$tempVar1=\"$tempVar1\";");
> >
> > and am obviously failing. If you know any other way to validate
> 120-150
> > variables in a loop and then rewrite the values into the fields
> > (checkboxes, radios and selects) - should an error had been made - let
> me
> > know.
> >
> > Best Regards,
> > Alex
> >
> > p.s. you do help! :)
>
>



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




RE: [PHP] *OK, more eval for today

2002-12-18 Thread John W. Holmes
Why not name your form elements php_q3[] and then just loop through the
array. That would cut the need for eval().

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -Original Message-
> From: Alexey Lysenkov [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 2:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] *OK, more eval for today
> 
> I know, it's eval = evil, but I don't see any other way I can check
for
> 120 variables submitted via post, without making a temp variable,
> assigning a value of the posted Var and checking for it (and deciding
on
> the further run of the script). Anyways, I took a classical eval thing
and
> am doing fine with it. It looks like this:
> 
> $temp = "\$php_q3_".$i; // $i is a loop index
> eval ("\$temp = \"$temp\";");
> 
> works alright. Now, how do I eval directly from the $HTTP_POST_VARS?
> 
> I am trying to do this:
> 
> $tempVar1 = '\$HTTP_POST_VARS[\"q4_'.$i.'"]';
>   eval("\$tempVar1=\"$tempVar1\";");
> 
> and am obviously failing. If you know any other way to validate
120-150
> variables in a loop and then rewrite the values into the fields
> (checkboxes, radios and selects) - should an error had been made - let
me
> know.
> 
> Best Regards,
> Alex
> 
> p.s. you do help! :)



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




Re: [PHP] ok what kind of crack is my computer smoking?

2002-06-27 Thread Rick Kukiela

i did restart the server

is there like a php install-to direcotry that php installed to that i should
remove before rebuilding, it seems like new make install didnt overwrite the
old install for some reason thats the only thing i can think of that
would cause this.

rick
- Original Message -
From: "Demitrious S. Kelly" <[EMAIL PROTECTED]>
To: "'Kurth Bemis (List Monkey)'" <[EMAIL PROTECTED]>
Cc: "'Rick Kukiela'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, June 27, 2002 4:30 PM
Subject: RE: [PHP] ok what kind of crack is my computer smoking?


> Whoa! Good idea!
>
> -Original Message-
> From: Kurth Bemis (List Monkey) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 27, 2002 2:35 PM
> To: Demitrious S. Kelly
> Cc: 'Rick Kukiela'; [EMAIL PROTECTED]
> Subject: RE: [PHP] ok what kind of crack is my computer smoking?
>
> At 02:19 PM 6/27/2002 -0700, Demitrious S. Kelly wrote:
>
> hey - RESTART APACHE!
>
> ~kurth
>
> >You check and make sure the date was set right on the box?
> >
> >You could try "make clean" for everything before configuring...
> >
> >
> >-Original Message-
> >From: Rick Kukiela [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, June 27, 2002 2:10 PM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] ok what kind of crack is my computer smoking?
> >
> >I needed to recompile php to support some extra features so i went to
> my
> >/usr/local/src direcotry and i rm -rf'ed apache mod_perl and php src
> >dirs.
> >
> >I then re-extracted the tarballs for thoes programs...
> >
> >Re built everything the way i normally did (including rm -rf
> >/usr/local/apache) which is my apache install dir before i rebuilt.
> >
> >I finish getting it all compiled and installed and start up apache,
> >
> >go to my phpinfo() script that just echos that func.
> >
> >and i get:
> >
> >build date: Jun 21 2002 16:47:12
> >when it should be
> >build dat: June 27 2002 13:00:00
> >
> >and the ./configure options are still the origional options...
> >
> >SO what do i have to do to get php to acknolege the fact that it has
> >been
> >recompiled with new options
> >
> >
> >Rick
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone
> Computer
>
> "Jedi business, Go back to your drinks" - Anakin Skywalker, AOTC
>
> [EMAIL PROTECTED] | http://kurth.hardcrypto.com
> PGP key available - http://kurth.hardcrypto.com/pgp
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP] ok what kind of crack is my computer smoking?

2002-06-27 Thread Demitrious S. Kelly

Whoa! Good idea!

-Original Message-
From: Kurth Bemis (List Monkey) [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 27, 2002 2:35 PM
To: Demitrious S. Kelly
Cc: 'Rick Kukiela'; [EMAIL PROTECTED]
Subject: RE: [PHP] ok what kind of crack is my computer smoking?

At 02:19 PM 6/27/2002 -0700, Demitrious S. Kelly wrote:

hey - RESTART APACHE!

~kurth

>You check and make sure the date was set right on the box?
>
>You could try "make clean" for everything before configuring...
>
>
>-Original Message-
>From: Rick Kukiela [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, June 27, 2002 2:10 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] ok what kind of crack is my computer smoking?
>
>I needed to recompile php to support some extra features so i went to
my
>/usr/local/src direcotry and i rm -rf'ed apache mod_perl and php src
>dirs.
>
>I then re-extracted the tarballs for thoes programs...
>
>Re built everything the way i normally did (including rm -rf
>/usr/local/apache) which is my apache install dir before i rebuilt.
>
>I finish getting it all compiled and installed and start up apache,
>
>go to my phpinfo() script that just echos that func.
>
>and i get:
>
>build date: Jun 21 2002 16:47:12
>when it should be
>build dat: June 27 2002 13:00:00
>
>and the ./configure options are still the origional options...
>
>SO what do i have to do to get php to acknolege the fact that it has
>been
>recompiled with new options
>
>
>Rick
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone
Computer

"Jedi business, Go back to your drinks" - Anakin Skywalker, AOTC

[EMAIL PROTECTED] | http://kurth.hardcrypto.com
PGP key available - http://kurth.hardcrypto.com/pgp



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




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




Re: [PHP] ok what kind of crack is my computer smoking?

2002-06-27 Thread Rick Kukiela

Thats what i did, i rm -rf /usr/local/src/apache_1.3.26 ; rm -rf
/usr/local/src/php-4.2.1 ; rm -rf /usr/local/src/mod_per-1.27

then i reextracted the tarballs and restarted totaly from scratch,
everything worked as expected except when i restarted it up its like nothing
changed.

rick
- Original Message -
From: "Erik Price" <[EMAIL PROTECTED]>
To: "Rick Kukiela" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, June 27, 2002 4:28 PM
Subject: Re: [PHP] ok what kind of crack is my computer smoking?


>
> On Thursday, June 27, 2002, at 05:09  PM, Rick Kukiela wrote:
>
> > SO what do i have to do to get php to acknolege the fact that it has
> > been
> > recompiled with new options
>
> Did you rm ./config.cache in the Apache source tree?
>
> If I were you, I'd remove the source trees you have, re-extract the
> tarballs, totally.  Not just for the modules but for Apache too.  It's
> just easier unless you have customized code in your Apache source tree.
>
>
> Erik
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP] ok what kind of crack is my computer smoking?

2002-06-27 Thread Kurth Bemis (List Monkey)

At 02:19 PM 6/27/2002 -0700, Demitrious S. Kelly wrote:

hey - RESTART APACHE!

~kurth

>You check and make sure the date was set right on the box?
>
>You could try "make clean" for everything before configuring...
>
>
>-Original Message-
>From: Rick Kukiela [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, June 27, 2002 2:10 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] ok what kind of crack is my computer smoking?
>
>I needed to recompile php to support some extra features so i went to my
>/usr/local/src direcotry and i rm -rf'ed apache mod_perl and php src
>dirs.
>
>I then re-extracted the tarballs for thoes programs...
>
>Re built everything the way i normally did (including rm -rf
>/usr/local/apache) which is my apache install dir before i rebuilt.
>
>I finish getting it all compiled and installed and start up apache,
>
>go to my phpinfo() script that just echos that func.
>
>and i get:
>
>build date: Jun 21 2002 16:47:12
>when it should be
>build dat: June 27 2002 13:00:00
>
>and the ./configure options are still the origional options...
>
>SO what do i have to do to get php to acknolege the fact that it has
>been
>recompiled with new options
>
>
>Rick
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

"Jedi business, Go back to your drinks" - Anakin Skywalker, AOTC

[EMAIL PROTECTED] | http://kurth.hardcrypto.com
PGP key available - http://kurth.hardcrypto.com/pgp



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




RE: [PHP] ok what kind of crack is my computer smoking?

2002-06-27 Thread Demitrious S. Kelly

You check and make sure the date was set right on the box?

You could try "make clean" for everything before configuring...


-Original Message-
From: Rick Kukiela [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 27, 2002 2:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ok what kind of crack is my computer smoking?

I needed to recompile php to support some extra features so i went to my
/usr/local/src direcotry and i rm -rf'ed apache mod_perl and php src
dirs.

I then re-extracted the tarballs for thoes programs...

Re built everything the way i normally did (including rm -rf
/usr/local/apache) which is my apache install dir before i rebuilt.

I finish getting it all compiled and installed and start up apache,

go to my phpinfo() script that just echos that func.

and i get:

build date: Jun 21 2002 16:47:12
when it should be
build dat: June 27 2002 13:00:00

and the ./configure options are still the origional options...

SO what do i have to do to get php to acknolege the fact that it has
been
recompiled with new options


Rick


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




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




Re: [PHP] ok what kind of crack is my computer smoking?

2002-06-27 Thread Erik Price


On Thursday, June 27, 2002, at 05:09  PM, Rick Kukiela wrote:

> SO what do i have to do to get php to acknolege the fact that it has 
> been
> recompiled with new options

Did you rm ./config.cache in the Apache source tree?

If I were you, I'd remove the source trees you have, re-extract the 
tarballs, totally.  Not just for the modules but for Apache too.  It's 
just easier unless you have customized code in your Apache source tree.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: Re: [PHP] OK Dan...

2002-03-05 Thread GENESiS DESiGNS

Dan,

I;m using PHP to create my database.
This is the script I'm using:
--



--

Thanks,

-GENESiS DESiGNS
-Sean Kennedy
-http://www.gdesigns.vcn.com


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




Re: [PHP] ok still want to join a project...

2002-02-09 Thread DL Neil

Emphasis on the second-last word?
=dn

- Original Message - 
From: "Nick Wilson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 09 February 2002 18:24
Subject: Re: [PHP] ok still want to join a project...


> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> 
> * and then Arik Ashepa declared
> > nice... anyone else has an idea?
> 
> How about a Haiku db?
> 
> The php list
> a place for conversation
> with other nutters
> 
> 
> 
> Hehe,.
> 
> - -- 
> 
> Nick Wilson
> 
> Tel: +45 3325 0688
> Fax: +45 3325 0677
> Web: www.explodingnet.com
> 
> 
> 
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
> 
> iD8DBQE8ZWlsHpvrrTa6L5oRAriVAJ9GR95YAg98CIspv2X4Zjom2K3T3gCfT1AM
> vZOV12HCCE89gRjMfgVs/cM=
> =wbyf
> -END PGP SIGNATURE-
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP] ok still want to join a project...

2002-02-09 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Arik Ashepa declared
> nice... anyone else has an idea?

How about a Haiku db?

The php list
a place for conversation
with other nutters



Hehe,.

- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8ZWlsHpvrrTa6L5oRAriVAJ9GR95YAg98CIspv2X4Zjom2K3T3gCfT1AM
vZOV12HCCE89gRjMfgVs/cM=
=wbyf
-END PGP SIGNATURE-

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




Re: [PHP] ok still want to join a project...

2002-02-09 Thread Arik Ashepa

nice... anyone else has an idea?

Jason Wong wrote:

> On Sunday 10 February 2002 01:42, Arik Ashepa wrote:
> 
>>any offers? or start one...
>>
> 
> If you're still stuck for ideas, how about a jobs board, something like 
> monster.com?
> 
> 
> 


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




  1   2   >