[PHP] Re: Sub Menu System?

2009-07-17 Thread David Robley
David Stoltz wrote:

> Folks,
> 
> I'm developing a rather large site in PHP. The main horizontal nav bar
> never changes, no matter how deep you are in the site. However, on the
> left side is a vertical "sub-menu" system. This menu is proving to be a
> real pain to program. I have it limited the menu system to 3 levels:
> 
> MAIN:
>  |___Secondary pages
>|___Tertiary pages
> 
> For each level, and each folder, I have a file called subnav.php, which
> contains the links for that page. It has its own code to determine the
> page it's on, and highlight the appropriate menu item.
> 
> The problem is when I need to move pages, or add pages, it's proving to
> be a REAL PAIN to maintain this type of structure.
> 
> Does anyone know of any off-the-shelf product that can create/maintain a
> sub-menu system like this?
> 
> I don't mind starting over at this point, but I'm hoping there is
> something I can just purchase, so I can concentrate on the rest of the
> sitehopefully the menu system would support PHP and ASP.
> 
> Thanks for any information!

I know your pain :-) I can't point you to a bolt on solution, but what you
probably want is a tree structure of some sort. Have a read of
http://www.sitepoint.com/print/hierarchical-data-database/ for the
concepts; scroll down to Modified Preorder Tree Traversal.

There seem to be a few nested set classes out there to manage this sort of
structure, e.g. http://www.edutech.ch/contribution/nstrees/index.php or
search on "nested trees".


Cheers
-- 
David Robley

A mind is a terrible thing to ... er ... h?
Today is Pungenday, the 52nd day of Confusion in the YOLD 3175. 


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



Re: [PHP] Add php.net to my browser search box

2009-07-17 Thread Michael Kubler



Jim Lucas wrote:

I use FF 2 & 3 and I created a bookmark that simply had a keyword
assigned to it.

Bookmark properties are as follows:

Name:   PHP.net
Location:   http://www.php.net/%s
Keyword:php
Description:Type "php " in the address bar
to perform a PHP.net search

Not sure if you can do this with other browsers, but I have found it to
be very useful.

Jim Lucas


I second that.
It's great to be able to type something like "PHP str_replace" into 
Firefox's address bar and go straight to the documentation on that function.


Michael Kubler
*G*rey *P*hoenix *P*roductions 




Re: [PHP] Add php.net to my browser search box

2009-07-17 Thread Michelle Konzack
Hello Jim,

Am 2009-07-16 09:40:53, schrieb Jim Lucas:
> I use FF 2 & 3 and I created a bookmark that simply had a keyword
> assigned to it.
> 
> Bookmark properties are as follows:
> 
> Name: PHP.net
> Location: http://www.php.net/%s
> Keyword:  php
> Description:  Type "php " in the address bar
>   to perform a PHP.net search
> 
> Not sure if you can do this with other browsers, but I have found it to
> be very useful.

You are great...  It works even with:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20070113 
Debian/1.7.8-1sarge10

on my nifty IBM ThinkPad 570.

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   c/o Shared Office KabelBW  ICQ #328449886
+49/177/9351947Blumenstasse 2 MSN LinuxMichi
+33/6/61925193 77694 Kehl/Germany IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] Linking to images above the webspace

2009-07-17 Thread Al
I've got a php script in which I'd like to link to an image above the webspace 
[doc-root] and render it as  or 


Anyone know how this can be done? Googling always refers me to document_root, 
where absolute or relative.


Do I first have to make a copy of the image and put it below doc_root?

Thanks

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



Re: [PHP] Linking to images above the webspace

2009-07-17 Thread Nitsan Bin-Nun
You can create a PHP script which will serve files based on their location
which will be transfered through a GET parameter.
Just send the correct response headers which will be corresponded to the
file's mime type, size, etc.

Then use something like:


Good luck!


On Fri, Jul 17, 2009 at 2:19 PM, Al  wrote:

> I've got a php script in which I'd like to link to an image above the
> webspace [doc-root] and render it as  or 
>
> Anyone know how this can be done? Googling always refers me to
> document_root, where absolute or relative.
>
> Do I first have to make a copy of the image and put it below doc_root?
>
> Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Linking to images above the webspace

2009-07-17 Thread Michelle Konzack
Am 2009-07-17 14:23:30, schrieb Nitsan Bin-Nun:
> You can create a PHP script which will serve files based on their location
> which will be transfered through a GET parameter.
> Just send the correct response headers which will be corresponded to the
> file's mime type, size, etc.
> 
> Then use something like:
> 
> 
> Good luck!

"Good luck!" is good...  He should be careful with such stuff... because
someone can do something like:

wget http://${SERVER}/a.php?image_full_path=/etc/passwd


Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   c/o Shared Office KabelBW  ICQ #328449886
+49/177/9351947Blumenstasse 2 MSN LinuxMichi
+33/6/61925193 77694 Kehl/Germany IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Linking to images above the webspace

2009-07-17 Thread Nitsan Bin-Nun
Everyone should be careful with every stuff, you can also inject a
LOAD_FILE('/etc/passwd') into a MYSQL query easily.

On Fri, Jul 17, 2009 at 2:28 PM, Michelle Konzack <
linux4miche...@tamay-dogan.net> wrote:

> Am 2009-07-17 14:23:30, schrieb Nitsan Bin-Nun:
> > You can create a PHP script which will serve files based on their
> location
> > which will be transfered through a GET parameter.
> > Just send the correct response headers which will be corresponded to the
> > file's mime type, size, etc.
> >
> > Then use something like:
> > 
> >
> > Good luck!
>
> "Good luck!" is good...  He should be careful with such stuff... because
> someone can do something like:
>
>wget http://${SERVER}/a.php?image_full_path=/etc/passwd
>
>
> Thanks, Greetings and nice Day/Evening
>Michelle Konzack
>Systemadministrator
>Tamay Dogan Network
>Debian GNU/Linux Consultant
>
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> # Debian GNU/Linux Consultant #
> Michelle Konzack   c/o Shared Office KabelBW  ICQ #328449886
> +49/177/9351947Blumenstasse 2 MSN LinuxMichi
> +33/6/61925193 77694 Kehl/Germany IRC #Debian (irc.icq.com)
>


Re: [PHP] Characters causing problems in search strings?

2009-07-17 Thread Bastien Koert
On Thu, Jul 16, 2009 at 5:40 PM, Miller,
Terion wrote:
> My little browse /search restaurant project is coming along, but I just
> noticed that any restaurant with a &, () or # in the name like say for
> example Arby's Store #12 ...will not return results... Yet if a name has a /
> or a - it's not a problem...
> 1. why is this and how do and where do I escape those characters on the
> query? Or on the insert?
>
> Thanks in Advance
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

There are really two approaches:

1. filter the data (remove the characters you decide you don't want in
there and are irrelevant)
2. encode them to store them

Personally I lean towards removing the unwanted characters. The main
reason is that you then can do a better job of controlling the data
when a query is made, spaces or other characters that are in the name
can result in queries that don't return any data because there is no
exact match

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Add php.net to my browser search box

2009-07-17 Thread Paul M Foster
On Thu, Jul 16, 2009 at 12:59:00PM -0300, Martin Scotta wrote:

> Hi all!
> 
> I'd like to add php.net to my browser search box.



Gee, I just keep a tab open to php.net at all times. Just like having
"Programming PHP" on my desk at all times.

Paul

-- 
Paul M. Foster

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



[PHP] Back from the dead with a racing question!

2009-07-17 Thread Jason Pruim

Hi everyone!

So some of you may have noticed that I have been away for quite  
awhile... Been trying to get settled (Moved across the country) and  
getting a job.


And now that that is done I have a question about a project that I  
might be doing for my current employer and want to do it properly.


If all goes through, I'll be writing an online database that upwards  
of 10 people will be using at various times through out the day.  
Basically, in a form they fill out a model number, customer name,  
phone number etc. etc.. And then submit the form. After submitting  
they need to write the log number on some paperwork. If I have 2  
people submit the form at the same time, I'm thinking I could end up  
with a race condition and they might get the wrong log number (The log  
number is simply a consecutive record number)


Do I need to be reading up on locking tables/rows? Or in my situation  
as I've briefly described it do I not have to worry about it? Or is  
there a third door with the magic bullet that will solve all my  
problems? :)


Any advice is greatly appreciated as always, RTFMing is good as well,  
as long as M is defined :)


I'm not afraid of google either, just need the right terms to hit it  
with so I don't go into "search overload" as the commercials for a  
rival search engine claim :)


Thanks Everyone!



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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Thorsten Suckow-Homberg
Jason, 

>Do I need to be reading up on locking tables/rows? Or in my situation  
>as I've briefly described it do I not have to worry about it? Or is  
>there a third door with the magic bullet that will solve all my  
>problems? :)
>
>Any advice is greatly appreciated as always, RTFMing is good as well,  
>as long as M is defined :)
>
>

When using mysql along with PHPs mysql_insert_id() 
(http://de.php.net/manual/en/function.mysql-insert-id.php), the docs say:

Note: 
   
Because mysql_insert_id() acts on the last performed
query, be sure to call mysql_insert_id() immediately 
after the query that generates the value.
   


So yes, from my point of view (which is in that case very paranoid), I'd say 
race conditions are possible to happen. One solution would be to save the user 
id along with the saved record, then fetch the last inserted record by this 
user and return the id for this record. A timestamp (microtime()) might also 
help.

On the other hand - yes, there is still the possbility of locking the table.

Regards

Thorsten


-- 
Thorsten Suckow-Homberg
Jakobstrasse 214-216
52064 Aachen
http://www.siteartwork.de

Tel.:  0151 -10927135
Email: t...@siteartwork.de

You should follow me on Twitter: http://twitter.com/ThorstenSuckow

Sent with conjoon. Visit http://www.conjoon.org

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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Bastien Koert
On Fri, Jul 17, 2009 at 11:12 AM, Jason Pruim wrote:
> Hi everyone!
>
> So some of you may have noticed that I have been away for quite awhile...
> Been trying to get settled (Moved across the country) and getting a job.
>
> And now that that is done I have a question about a project that I might be
> doing for my current employer and want to do it properly.
>
> If all goes through, I'll be writing an online database that upwards of 10
> people will be using at various times through out the day. Basically, in a
> form they fill out a model number, customer name, phone number etc. etc..
> And then submit the form. After submitting they need to write the log number
> on some paperwork. If I have 2 people submit the form at the same time, I'm
> thinking I could end up with a race condition and they might get the wrong
> log number (The log number is simply a consecutive record number)
>
> Do I need to be reading up on locking tables/rows? Or in my situation as
> I've briefly described it do I not have to worry about it? Or is there a
> third door with the magic bullet that will solve all my problems? :)
>
> Any advice is greatly appreciated as always, RTFMing is good as well, as
> long as M is defined :)
>
> I'm not afraid of google either, just need the right terms to hit it with so
> I don't go into "search overload" as the commercials for a rival search
> engine claim :)
>
> Thanks Everyone!
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Hey Prune,

nice to see ya again.

Is the log number formatted? If not, just use an autonumber in the
database. Most allow you to pick the starting point so setting the
value shouldn't be a problem.


-- 

Bastien

Cat, the other other white meat

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



[PHP] another pagination problem

2009-07-17 Thread PJ
I noticed the thread on pagination here just after posting to mysql. But
I am using php/mysql ;-)
I have some rather complicated ordering problems:
1. need to order by 2 fields title, sub_title
2. need to display 10 items per page (hundreds, if not 1000s or pages)
3. order by ASC or DESC makes not difference when ordering by 2 fields
4. when ordering by title, results are totally different for ASC & DESC;
not the same data at all (Is the ordering done on the entire db? )
5. those funny little dingles over foreign language characters refuse to
follow our normal ordering rules; how do we do this?
6. The pagination and ordering syntax is correct & working with no
errors; I've double checked on commandline.
7. At worst, I'll have to leave it at ASC and let visitors p&m; don't
see a simple solution.

Or am I wrong?


-- 
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Ashley Sheridan
On Friday 17 July 2009 16:27:10 Bastien Koert wrote:
> On Fri, Jul 17, 2009 at 11:12 AM, Jason Pruim wrote:
> > Hi everyone!
> >
> > So some of you may have noticed that I have been away for quite awhile...
> > Been trying to get settled (Moved across the country) and getting a job.
> >
> > And now that that is done I have a question about a project that I might
> > be doing for my current employer and want to do it properly.
> >
> > If all goes through, I'll be writing an online database that upwards of
> > 10 people will be using at various times through out the day. Basically,
> > in a form they fill out a model number, customer name, phone number etc.
> > etc.. And then submit the form. After submitting they need to write the
> > log number on some paperwork. If I have 2 people submit the form at the
> > same time, I'm thinking I could end up with a race condition and they
> > might get the wrong log number (The log number is simply a consecutive
> > record number)
> >
> > Do I need to be reading up on locking tables/rows? Or in my situation as
> > I've briefly described it do I not have to worry about it? Or is there a
> > third door with the magic bullet that will solve all my problems? :)
> >
> > Any advice is greatly appreciated as always, RTFMing is good as well, as
> > long as M is defined :)
> >
> > I'm not afraid of google either, just need the right terms to hit it with
> > so I don't go into "search overload" as the commercials for a rival
> > search engine claim :)
> >
> > Thanks Everyone!
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> Hey Prune,
>
> nice to see ya again.
>
> Is the log number formatted? If not, just use an autonumber in the
> database. Most allow you to pick the starting point so setting the
> value shouldn't be a problem.
>
>
> --
>
> Bastien
>
> Cat, the other other white meat

Just have a field that is an auto_increment in the table, and the database can 
sort out making sure it is unique. You can use this as part of your log 
number if you wish to ensure that the log number is also unique, or just use 
the auto_id value straight up.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk

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



Re: [PHP] another pagination problem

2009-07-17 Thread Ashley Sheridan
On Friday 17 July 2009 16:35:10 PJ wrote:
> I noticed the thread on pagination here just after posting to mysql. But
> I am using php/mysql ;-)
> I have some rather complicated ordering problems:
> 1. need to order by 2 fields title, sub_title
> 2. need to display 10 items per page (hundreds, if not 1000s or pages)
> 3. order by ASC or DESC makes not difference when ordering by 2 fields
> 4. when ordering by title, results are totally different for ASC & DESC;
> not the same data at all (Is the ordering done on the entire db? )
> 5. those funny little dingles over foreign language characters refuse to
> follow our normal ordering rules; how do we do this?
> 6. The pagination and ordering syntax is correct & working with no
> errors; I've double checked on commandline.
> 7. At worst, I'll have to leave it at ASC and let visitors p&m; don't
> see a simple solution.
>
> Or am I wrong?
>
>
> --
> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> -
> Phil Jourdan --- p...@ptahhotep.com
>http://www.ptahhotep.com
>http://www.chiccantine.com/andypantry.php

How are you attempting to order the query, do you have an excerpt? I've never 
had any problems ordering my results based on more than one field, where the 
orders are based on a mixture of ASC and DESC fields. The ordering part looks 
something like this:

ORDER BY `field1` DESC, `field2` ASC, `field3` DESC

and that works just fine for me. Also, what character set are you using on 
that table, as that may have a difference on how the ordering works.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk

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



Re: [PHP] another pagination problem

2009-07-17 Thread PJ
Ashley Sheridan wrote:
> On Friday 17 July 2009 16:35:10 PJ wrote:
>   
>> I noticed the thread on pagination here just after posting to mysql. But
>> I am using php/mysql ;-)
>> I have some rather complicated ordering problems:
>> 1. need to order by 2 fields title, sub_title
>> 2. need to display 10 items per page (hundreds, if not 1000s or pages)
>> 3. order by ASC or DESC makes not difference when ordering by 2 fields
>> 4. when ordering by title, results are totally different for ASC & DESC;
>> not the same data at all (Is the ordering done on the entire db? )
>> 5. those funny little dingles over foreign language characters refuse to
>> follow our normal ordering rules; how do we do this?
>> 6. The pagination and ordering syntax is correct & working with no
>> errors; I've double checked on commandline.
>> 7. At worst, I'll have to leave it at ASC and let visitors p&m; don't
>> see a simple solution.
>>
>> Or am I wrong?
>>
>>
>> --
>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
>> -
>> Phil Jourdan --- p...@ptahhotep.com
>>http://www.ptahhotep.com
>>http://www.chiccantine.com/andypantry.php
>> 
>
> How are you attempting to order the query, do you have an excerpt? I've never 
> had any problems ordering my results based on more than one field, where the 
> orders are based on a mixture of ASC and DESC fields. The ordering part looks 
> something like this:
>
> ORDER BY `field1` DESC, `field2` ASC, `field3` DESC
>
> and that works just fine for me. Also, what character set are you using on 
> that table, as that may have a difference on how the ordering works.
>
>   
Here's the query:
"SELECT * FROM book ORDER BY $sort $dir LIMIT $offset, $records_per_page";
$sort == 'title, sub_title'; $dir==ASC (or DESC); $offset== (any
multiple of 10); $records_per_page== 10;
I could let the user change these, but I decided it is simpler to keep
it at 10 books/page. Only the $dir is user settable.
The character set is utf8-general; (I just went through some
self-torture changing all those foreign curlicues to :&cutesy_stuff;
fortunately, the mysql replace() function helped - but six languages
have quite a few weird accents.
The title field can be fairly long - 182 chars; sub_title is 128, but it
looks like I have to lengthen that too; found some truncated inputs.

-- 
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Paul M Foster
On Fri, Jul 17, 2009 at 11:12:43AM -0400, Jason Pruim wrote:

> Hi everyone!
>
> So some of you may have noticed that I have been away for quite
> awhile... Been trying to get settled (Moved across the country) and
> getting a job.
>
> And now that that is done I have a question about a project that I
> might be doing for my current employer and want to do it properly.
>
> If all goes through, I'll be writing an online database that upwards
> of 10 people will be using at various times through out the day.
> Basically, in a form they fill out a model number, customer name,
> phone number etc. etc.. And then submit the form. After submitting
> they need to write the log number on some paperwork. If I have 2
> people submit the form at the same time, I'm thinking I could end up
> with a race condition and they might get the wrong log number (The log
> number is simply a consecutive record number)
>
> Do I need to be reading up on locking tables/rows? Or in my situation
> as I've briefly described it do I not have to worry about it? Or is
> there a third door with the magic bullet that will solve all my
> problems? :)

The database engine should take care of this for you. You left out some
details, so I'll make some assumptions. And I can only speak for
PostgreSQL, since I don't work that much with MySQL.

When using sequences in PostgreSQL, you can use the currval() function
to grab the last id number for the last record you added in this
session. Someone else running currval() will get the id number for the
last record they entered in their current session. No race condition
possible. In all this, I assume you just added a record and you want to
get the ID of that record. If you added a record yesterday, that's a
different story, but should not allow race conditions. A good database
engine should protect you in this area.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread tedd

At 11:12 AM -0400 7/17/09, Jason Pruim wrote:

Hi everyone!

So some of you may have noticed that I have been away for quite 
awhile... Been trying to get settled (Moved across the country) and 
getting a job.


And now that that is done I have a question about a project that I 
might be doing for my current employer and want to do it properly.


If all goes through, I'll be writing an online database that upwards 
of 10 people will be using at various times through out the day. 
Basically, in a form they fill out a model number, customer name, 
phone number etc. etc.. And then submit the form. After submitting 
they need to write the log number on some paperwork. If I have 2 
people submit the form at the same time, I'm thinking I could end up 
with a race condition and they might get the wrong log number (The 
log number is simply a consecutive record number)


Do I need to be reading up on locking tables/rows? Or in my 
situation as I've briefly described it do I not have to worry about 
it? Or is there a third door with the magic bullet that will solve 
all my problems? :)


Any advice is greatly appreciated as always, RTFMing is good as 
well, as long as M is defined :)


I'm not afraid of google either, just need the right terms to hit it 
with so I don't go into "search overload" as the commercials for a 
rival search engine claim :)


Thanks Everyone!


Jason:

Welcome back.

Clearly if you have two or more people checkout the same record at 
the same time and each edits the record then you ARE going to have 
problems when each updates the record.


You can solve this problem by using transactions -- here's a link:

http://dev.mysql.com/doc/refman/5.0/en/lock-tables-and-transactions.html

When someone is editing a record, you also need to be able to show 
the next person(s) that the record they want is currently busy and 
not available. However, I'm not sure as to how to notify the next 
user that the table is locked via php. Perhaps a table status might 
provide that information. If so, then use that to notify the next 
user.


As for your log of activity, just create a another record (with an 
auto_increment index) in your activity log table and update that 
record with the data you need to record, such as user id, timestamp, 
what record they accessed and whatever else you want after the 
transaction is completed.


Cheers,

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] another pagination problem

2009-07-17 Thread PJ
Ashley Sheridan wrote:
> On Friday 17 July 2009 16:35:10 PJ wrote:
>   
>> I noticed the thread on pagination here just after posting to mysql. But
>> I am using php/mysql ;-)
>> I have some rather complicated ordering problems:
>> 1. need to order by 2 fields title, sub_title
>> 2. need to display 10 items per page (hundreds, if not 1000s or pages)
>> 3. order by ASC or DESC makes not difference when ordering by 2 fields
>> 4. when ordering by title, results are totally different for ASC & DESC;
>> not the same data at all (Is the ordering done on the entire db? )
>> 5. those funny little dingles over foreign language characters refuse to
>> follow our normal ordering rules; how do we do this?
>> 6. The pagination and ordering syntax is correct & working with no
>> errors; I've double checked on commandline.
>> 7. At worst, I'll have to leave it at ASC and let visitors p&m; don't
>> see a simple solution.
>>
>> Or am I wrong?
>>
>>
>> --
>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
>> -
>> Phil Jourdan --- p...@ptahhotep.com
>>http://www.ptahhotep.com
>>http://www.chiccantine.com/andypantry.php
>> 
>
> How are you attempting to order the query, do you have an excerpt? I've never 
> had any problems ordering my results based on more than one field, where the 
> orders are based on a mixture of ASC and DESC fields. The ordering part looks 
> something like this:
>
> ORDER BY `field1` DESC, `field2` ASC, `field3` DESC
>
> and that works just fine for me. Also, what character set are you using on 
> that table, as that may have a difference on how the ordering works.
>
>   
Sorry, forgot: another problem is the Thes - how do you exclude them
from the ordering.

Also: one output with just title for field returned a series of The
Art.., The Birds..., The Birth...etc. in ASC; whereas DESC returned:
Boats, Black Cumin, Birds of..., Biological..., Bioarchaeology..,
Avaris... etc.

-- 
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Bastien Koert
On Fri, Jul 17, 2009 at 11:51 AM, tedd wrote:
> At 11:12 AM -0400 7/17/09, Jason Pruim wrote:
>>
>> Hi everyone!
>>
>> So some of you may have noticed that I have been away for quite awhile...
>> Been trying to get settled (Moved across the country) and getting a job.
>>
>> And now that that is done I have a question about a project that I might
>> be doing for my current employer and want to do it properly.
>>
>> If all goes through, I'll be writing an online database that upwards of 10
>> people will be using at various times through out the day. Basically, in a
>> form they fill out a model number, customer name, phone number etc. etc..
>> And then submit the form. After submitting they need to write the log number
>> on some paperwork. If I have 2 people submit the form at the same time, I'm
>> thinking I could end up with a race condition and they might get the wrong
>> log number (The log number is simply a consecutive record number)
>>
>> Do I need to be reading up on locking tables/rows? Or in my situation as
>> I've briefly described it do I not have to worry about it? Or is there a
>> third door with the magic bullet that will solve all my problems? :)
>>
>> Any advice is greatly appreciated as always, RTFMing is good as well, as
>> long as M is defined :)
>>
>> I'm not afraid of google either, just need the right terms to hit it with
>> so I don't go into "search overload" as the commercials for a rival search
>> engine claim :)
>>
>> Thanks Everyone!
>
> Jason:
>
> Welcome back.
>
> Clearly if you have two or more people checkout the same record at the same
> time and each edits the record then you ARE going to have problems when each
> updates the record.
>
> You can solve this problem by using transactions -- here's a link:
>
> http://dev.mysql.com/doc/refman/5.0/en/lock-tables-and-transactions.html
>
> When someone is editing a record, you also need to be able to show the next
> person(s) that the record they want is currently busy and not available.
> However, I'm not sure as to how to notify the next user that the table is
> locked via php. Perhaps a table status might provide that information. If
> so, then use that to notify the next user.
>
> As for your log of activity, just create a another record (with an
> auto_increment index) in your activity log table and update that record with
> the data you need to record, such as user id, timestamp, what record they
> accessed and whatever else you want after the transaction is completed.
>
> Cheers,
>
> 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
>
>

As a further note to tedd's reply on transactions, you will need to
use the INNODB engine in mysql should you want to use transactions.
Transactions here are done a row locking level not table so you should
have fewer issues.

-- 

Bastien

Cat, the other other white meat

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



[PHP] Re: Exception not being caught

2009-07-17 Thread Lupus Michaelis

Weston C a écrit :


If it's catchable, why isn't it caught in my example?


  This is well-documented here 



--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

Seeking for a position 

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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Jason Pruim


On Jul 17, 2009, at 11:56 AM, Bastien Koert wrote:


On Fri, Jul 17, 2009 at 11:51 AM, tedd wrote:

At 11:12 AM -0400 7/17/09, Jason Pruim wrote:


Hi everyone!

So some of you may have noticed that I have been away for quite  
awhile...
Been trying to get settled (Moved across the country) and getting  
a job.


And now that that is done I have a question about a project that I  
might

be doing for my current employer and want to do it properly.

If all goes through, I'll be writing an online database that  
upwards of 10
people will be using at various times through out the day.  
Basically, in a
form they fill out a model number, customer name, phone number  
etc. etc..
And then submit the form. After submitting they need to write the  
log number
on some paperwork. If I have 2 people submit the form at the same  
time, I'm
thinking I could end up with a race condition and they might get  
the wrong

log number (The log number is simply a consecutive record number)

Do I need to be reading up on locking tables/rows? Or in my  
situation as
I've briefly described it do I not have to worry about it? Or is  
there a

third door with the magic bullet that will solve all my problems? :)

Any advice is greatly appreciated as always, RTFMing is good as  
well, as

long as M is defined :)

I'm not afraid of google either, just need the right terms to hit  
it with
so I don't go into "search overload" as the commercials for a  
rival search

engine claim :)

Thanks Everyone!


Jason:

Welcome back.

Clearly if you have two or more people checkout the same record at  
the same
time and each edits the record then you ARE going to have problems  
when each

updates the record.

You can solve this problem by using transactions -- here's a link:

http://dev.mysql.com/doc/refman/5.0/en/lock-tables-and-transactions.html

When someone is editing a record, you also need to be able to show  
the next
person(s) that the record they want is currently busy and not  
available.
However, I'm not sure as to how to notify the next user that the  
table is
locked via php. Perhaps a table status might provide that  
information. If

so, then use that to notify the next user.

As for your log of activity, just create a another record (with an
auto_increment index) in your activity log table and update that  
record with
the data you need to record, such as user id, timestamp, what  
record they
accessed and whatever else you want after the transaction is  
completed.


Cheers,

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




As a further note to tedd's reply on transactions, you will need to
use the INNODB engine in mysql should you want to use transactions.
Transactions here are done a row locking level not table so you should
have fewer issues.


I also just found out that unless I can convince them to host it off  
site, it'll be on a windows machine  So php & mssql... Does that  
change alot?


To answer some of the other questions the Log number is currently just  
an auto incrementing consuctive number. So an auto+increment would  
work perfectly. What I'm trying to avoid is:


User1
User2

User1 submits to log number 12345
User2 submits to log number 12346

User1 is told their log number is 12346
User2 is told their log number is 12346

But User1 & User2 are on different computers... And if it's as easy as  
using the equivelant for: SELECT * FROM table WHERE UserID="User1"  
ORDER BY lognumber desc LIMIT 1; Then I'm good... I know how to  
proceed with writing it... Just need to figure out how to bill/sell  
it! ;)





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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Bastien Koert
On Fri, Jul 17, 2009 at 1:54 PM, Jason Pruim wrote:
>
> On Jul 17, 2009, at 11:56 AM, Bastien Koert wrote:
>
>> On Fri, Jul 17, 2009 at 11:51 AM, tedd wrote:
>>>
>>> At 11:12 AM -0400 7/17/09, Jason Pruim wrote:

 Hi everyone!

 So some of you may have noticed that I have been away for quite
 awhile...
 Been trying to get settled (Moved across the country) and getting a job.

 And now that that is done I have a question about a project that I might
 be doing for my current employer and want to do it properly.

 If all goes through, I'll be writing an online database that upwards of
 10
 people will be using at various times through out the day. Basically, in
 a
 form they fill out a model number, customer name, phone number etc.
 etc..
 And then submit the form. After submitting they need to write the log
 number
 on some paperwork. If I have 2 people submit the form at the same time,
 I'm
 thinking I could end up with a race condition and they might get the
 wrong
 log number (The log number is simply a consecutive record number)

 Do I need to be reading up on locking tables/rows? Or in my situation as
 I've briefly described it do I not have to worry about it? Or is there a
 third door with the magic bullet that will solve all my problems? :)

 Any advice is greatly appreciated as always, RTFMing is good as well, as
 long as M is defined :)

 I'm not afraid of google either, just need the right terms to hit it
 with
 so I don't go into "search overload" as the commercials for a rival
 search
 engine claim :)

 Thanks Everyone!
>>>
>>> Jason:
>>>
>>> Welcome back.
>>>
>>> Clearly if you have two or more people checkout the same record at the
>>> same
>>> time and each edits the record then you ARE going to have problems when
>>> each
>>> updates the record.
>>>
>>> You can solve this problem by using transactions -- here's a link:
>>>
>>> http://dev.mysql.com/doc/refman/5.0/en/lock-tables-and-transactions.html
>>>
>>> When someone is editing a record, you also need to be able to show the
>>> next
>>> person(s) that the record they want is currently busy and not available.
>>> However, I'm not sure as to how to notify the next user that the table is
>>> locked via php. Perhaps a table status might provide that information. If
>>> so, then use that to notify the next user.
>>>
>>> As for your log of activity, just create a another record (with an
>>> auto_increment index) in your activity log table and update that record
>>> with
>>> the data you need to record, such as user id, timestamp, what record they
>>> accessed and whatever else you want after the transaction is completed.
>>>
>>> Cheers,
>>>
>>> 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
>>>
>>>
>>
>> As a further note to tedd's reply on transactions, you will need to
>> use the INNODB engine in mysql should you want to use transactions.
>> Transactions here are done a row locking level not table so you should
>> have fewer issues.
>
> I also just found out that unless I can convince them to host it off site,
> it'll be on a windows machine  So php & mssql... Does that change alot?
>
> To answer some of the other questions the Log number is currently just an
> auto incrementing consuctive number. So an auto+increment would work
> perfectly. What I'm trying to avoid is:
>
> User1
> User2
>
> User1 submits to log number 12345
> User2 submits to log number 12346
>
> User1 is told their log number is 12346
> User2 is told their log number is 12346
>
> But User1 & User2 are on different computers... And if it's as easy as using
> the equivelant for: SELECT * FROM table WHERE UserID="User1" ORDER BY
> lognumber desc LIMIT 1; Then I'm good... I know how to proceed with writing
> it... Just need to figure out how to bill/sell it! ;)
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

MSSQL doesn't allow limit, but you can do a

select top 1 * from table [where] [order by lognumber desc]

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread Floyd Resler


On Jul 17, 2009, at 1:54 PM, Jason Pruim wrote:



On Jul 17, 2009, at 11:56 AM, Bastien Koert wrote:

On Fri, Jul 17, 2009 at 11:51 AM, tedd  
wrote:

At 11:12 AM -0400 7/17/09, Jason Pruim wrote:


Hi everyone!

So some of you may have noticed that I have been away for quite  
awhile...
Been trying to get settled (Moved across the country) and getting  
a job.


And now that that is done I have a question about a project that  
I might

be doing for my current employer and want to do it properly.

If all goes through, I'll be writing an online database that  
upwards of 10
people will be using at various times through out the day.  
Basically, in a
form they fill out a model number, customer name, phone number  
etc. etc..
And then submit the form. After submitting they need to write the  
log number
on some paperwork. If I have 2 people submit the form at the same  
time, I'm
thinking I could end up with a race condition and they might get  
the wrong

log number (The log number is simply a consecutive record number)

Do I need to be reading up on locking tables/rows? Or in my  
situation as
I've briefly described it do I not have to worry about it? Or is  
there a
third door with the magic bullet that will solve all my  
problems? :)


Any advice is greatly appreciated as always, RTFMing is good as  
well, as

long as M is defined :)

I'm not afraid of google either, just need the right terms to hit  
it with
so I don't go into "search overload" as the commercials for a  
rival search

engine claim :)

Thanks Everyone!


Jason:

Welcome back.

Clearly if you have two or more people checkout the same record at  
the same
time and each edits the record then you ARE going to have problems  
when each

updates the record.

You can solve this problem by using transactions -- here's a link:

http://dev.mysql.com/doc/refman/5.0/en/lock-tables-and-transactions.html

When someone is editing a record, you also need to be able to show  
the next
person(s) that the record they want is currently busy and not  
available.
However, I'm not sure as to how to notify the next user that the  
table is
locked via php. Perhaps a table status might provide that  
information. If

so, then use that to notify the next user.

As for your log of activity, just create a another record (with an
auto_increment index) in your activity log table and update that  
record with
the data you need to record, such as user id, timestamp, what  
record they
accessed and whatever else you want after the transaction is  
completed.


Cheers,

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




As a further note to tedd's reply on transactions, you will need to
use the INNODB engine in mysql should you want to use transactions.
Transactions here are done a row locking level not table so you  
should

have fewer issues.


I also just found out that unless I can convince them to host it off  
site, it'll be on a windows machine  So php & mssql... Does that  
change alot?


To answer some of the other questions the Log number is currently  
just an auto incrementing consuctive number. So an auto+increment  
would work perfectly. What I'm trying to avoid is:


User1
User2

User1 submits to log number 12345
User2 submits to log number 12346

User1 is told their log number is 12346
User2 is told their log number is 12346

But User1 & User2 are on different computers... And if it's as easy  
as using the equivelant for: SELECT * FROM table WHERE  
UserID="User1" ORDER BY lognumber desc LIMIT 1; Then I'm good... I  
know how to proceed with writing it... Just need to figure out how  
to bill/sell it! ;)





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




Here's something I do.  One of our clients likes to see job numbers  
instead of record numbers.  So, I simply convert the record number  
into a job number.  It begins with the current year and then I pad it  
out to 10 characters.  So, record number 72 becomes job number  
200972.




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



[PHP] Dual PHP installation and session sharing

2009-07-17 Thread Bruno Fajardo
Hi all,

I'm using Apache/2.2.3 (Linux/SUSE), running PHP 4.4.7 in CGI mode, in a
dual installation with PHP 5.1.2 running as an Apache module.
Scripts with .php5 extension are executed by PHP 5, and those with .php are
executed by PHP 4, and everything runs as expected.
My question is: is it possible to share session data between .php and .php5
scripts in this environment? All my tests failed.

Thanks in advance!


Re: [PHP] Back from the dead with a racing question!

2009-07-17 Thread ray
I strongly believe you have nothing to worry about and I think you are 
over-thinking an issue that will never happen to you.

Even if you have 2000 users, you will have nothing to worry about.

I manage db's on large scales and have run into every problem I never 
imaginged and always figured out how to fix it.
Throughout the years I have heard this particular issue come up among 
novices and the heard vaugue suggestions given from people with little 
experience.


There is no way you are going to run across a "race condition" because 
queries that are waiting to be processes have the status of "wait" while a 
table is locked.

Its basically put into a queue.
You can use INSERT DELAYED to better manage this if you are using MYISAM if 
you experience a much higher volume of inserts.


For apps that have a very high INSERT frequency, I suggest using INNODB so 
you won't experience table locking.


For your case, you have only 10 users and that is absolutely nothing to 
worry about.


If you are concerned about multiple users accessing a row of data at the 
same time, you will need to use INNODB and implement transactional queries.


This assumes you are using mysql of course. If you are using mssql, then I 
cannot provide a good answer because I do not use that db.


-Ray Solomon



- Original Message - 
From: "Jason Pruim" 

To: "PHP-General List" 
Sent: Friday, July 17, 2009 8:12 AM
Subject: [PHP] Back from the dead with a racing question!



Hi everyone!

So some of you may have noticed that I have been away for quite  awhile... 
Been trying to get settled (Moved across the country) and  getting a job.


And now that that is done I have a question about a project that I  might 
be doing for my current employer and want to do it properly.


If all goes through, I'll be writing an online database that upwards  of 
10 people will be using at various times through out the day.  Basically, 
in a form they fill out a model number, customer name,  phone number etc. 
etc.. And then submit the form. After submitting  they need to write the 
log number on some paperwork. If I have 2  people submit the form at the 
same time, I'm thinking I could end up  with a race condition and they 
might get the wrong log number (The log  number is simply a consecutive 
record number)


Do I need to be reading up on locking tables/rows? Or in my situation  as 
I've briefly described it do I not have to worry about it? Or is  there a 
third door with the magic bullet that will solve all my  problems? :)


Any advice is greatly appreciated as always, RTFMing is good as well,  as 
long as M is defined :)


I'm not afraid of google either, just need the right terms to hit it  with 
so I don't go into "search overload" as the commercials for a  rival 
search engine claim :)


Thanks Everyone!



--
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] DHCP web interface. New version.

2009-07-17 Thread Daevid Vincent
Once again I've updated this web tool.

The big difference is that now you don't need to be running DHCP on your Web
server. It works 'stand alone'. Perfect for those using a router box (as
most are I'm sure).

A while ago I switched from having my Gentoo box be my firewall, router,
wifi, dhcp, mail, web, svn, etc... (basically everything) to an Ubuntu box
that does web/mail/etc. and a DIR-655 router which does firewall and wifi
too. This broke the script.

http://daevid.com/examples/dhcp/

The next version when I get around to it, will be even more clean as right
now it uses 'arp' and 'nmap' to get the results. Turns out, I don't really
need 'arp' (which is also not reliable) and nmap (has XML output too) will
be perfect. Not sure when that will be, but I've got myself a Trac ticket to
rewrite this. 

> -Original Message-
> From: Daevid Vincent [mailto:dae...@daevid.com] 
> Sent: Tuesday, December 02, 2003 11:06 PM
> To: php-general@lists.php.net
> Cc: 'MKlinke'
> Subject: RE: [PHP] DHCP web interface. New version.
> 
> Once again, I have a new version of my DHCP web page. The 
> major fix in this
> one is that it does an "nmap -v -p 80 192.168.1.0/24" (thanks 
> to Mike Klinke
> for the idea) to re-populate the "arp -n". The old version of 
> my program
> would not always show ALL devices on the network. Some would 
> also show up as
> "incomplete". I have removed all incomplete ones for this 
> version, but you
> could simply comment out the line to put them back if you 
> want them. You can
> specify the server's IP manually (as in the case of dual NIC 
> cards), or let
> the script figure it out for you. 
> 
> http://daevid.com/examples/dhcp/
> 
> Daevid.
> 
> 
> > -Original Message-
> > From: Daevid Vincent [mailto:dae...@daevid.com] 
> > Sent: Monday, July 28, 2003 9:41 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] DHCP web interface. New version.
> > 
> > Heya. I've just put up a new version of the DHCP web front 
> > end if anyone is
> > using it or has a need for this type of thing.
> > 
> > Major feature of this version:
> > 
> > * a bug where if the arp table showed an "(incomplete)", I 
> > ignored the entry
> >   since the MAC is the hash key, many machines wouldn't show 
> > up as they kept
> >   over writing each other (of course, they were bunk anyways)
> > * ping & nmap tests (if ping fails, nmap is used as a backup)
> >   this is useful for firewalls that may block ICMP
> > * tests can be disabled for radically faster page rendering 
> > (off by default)
> > * 10 minute refresh by default rather than 10 second.
> > * SORTING! by IP now, rather than arp entries
> > * many more icons (tivo, zaurus, replay, linux, notebook, 
> > servers, DAR, etc)
> > * complete/incomplete tally
> > * Name in config file is only used if dhcp doesn't show a 
> name already
> > 
> > This is also IMHO an excellent way for a beginer or advanced 
> > coder alike to
> > see some very useful OOP/PHP coding as I use arrays of 
> > objects, sorting by
> > variables IN the object (custom sort algorithm with key 
> > integrity), hashing,
> > system calls, regex parsing, DHTML, etc. 
> > 
> > If anyone knows how to force the arp table to be current, 
> > that would help.
> > Sometimes a machine is on the network, and I *know* for a 
> > fact it is, but it
> > doesn't show up in "arp -n" *grumble*. 
> > 
> > Follow the link below. 
> > http://daevid.com/examples/dhcp/
> 
> -- 
> 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] Internal PHP caching methodology

2009-07-17 Thread Daniel Kolbo
Eric Butera wrote:
> On Thu, Jul 16, 2009 at 5:50 PM, Daniel Kolbo wrote:
>> Hello,
>>
>> Call me a dreamer...but I got to ask.
>>
>> Is there any software for helping speed up PHP by utilizing internal PHP
>> caching?
>>
>> I am not talking about the external php cache/header control.  Smarty
>> caching doesn't give me the control I need either.
>>
>> I would like to cache to a finer level than page by page, but rather on
>> a module by module basis.  Each of my pages contains a subset of
>> modules.  The content of these modules changes based upon certain
>> criteria (link, time, session data, but is sometimes static across the
>> site).  I would like to be able to cache individual "modules"
>> (preferably based upon frequency and time to generate).
>>
>> I am trying to develop a way to do this, but I have to think a brighter
>> mind has come before me and hopefully arrived at a solution.
>>
>> As always any help/thoughts are much appreciated, except for that one
>> guy's comments (you all know who I am talking) ~ jk ;)
>>
>> Thanks,
>> `
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
> Have you actually profiled your code to see where the pain points are
> vs saying 'module?'  Are you also running an opcode cache?  From there
> you can use data, block, or full page caching.  Finally you can figure
> out if you want to store it in flat files or memory.  I'd start by
> knowing what is actually the slow part using Xdebug and nail a few
> down.
> 
> There is no end all solution.  Some pages really don't have a lot
> going on and are hardly updated so full page is fine.  Others might
> have something that is hard to generate on a sidebar, so block caching
> would be more suitable for that.  As previously mentioned, Zend_Cache
> is up to the task.  There is also a PEAR package called Cache_Lite
> which would work to if you're interested in file based caching.
> 

So dreams do come true...

Thank you for the wonderful insight.  I've been reading about the
memcached and Xdebug and Zend_Cache.  I've got lots to learn, but it is
exactly the type of material i was trying to find.

I am not currently running an opcode cache.  I may be doing "premature
optimization", but i want to design the entire system intelligently from
the get go rather than having to rebuild later.  you know 'work smarter
not harder'

Is it possible to run xdebug on a virtual host server on which i do not
have shell access?  I can modify php.ini via cgi, but I don't know if
i'd be able to view the results of xdebug on the machine.  Your opinion
would be appreciated.

Thanks so much, i feel like i've just been shown a whole new world.
dK
`


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



[PHP] PHP 5.3 date.timezone

2009-07-17 Thread John Corry
Why is date.timezone blank...I'm setting it in the config file?
How come PHP is ignorning teh directives I have set in the .ini?

OS X with PHP 5.3 compiled from source on Apache 2.2.9

WTF?

Here's my php.ini file:[Date]
; Defines the default timezone used by the date functions
date.timezone = America/New_York

date.default_latitude = 34.3044
date.default_longitude = -83.8338

;date.sunrise_zenith = 90.58
;date.sunset_zenith = 90.58

But here's my phpinfo() output:
*Warning*: phpinfo()
[function.phpinfo]:
It is not safe to rely on the system's timezone settings. You are *required*
to use the date.timezone setting or the date_default_timezone_set()
function. In case you used any of those methods and you are still getting
this warning, you most likely misspelled the timezone identifier. We
selected 'America/New_York' for 'EDT/-4.0/DST' instead in *
/Users/jcorry/web_work/jcorry/httpdocs/info.php* on line *2*
 date/time support enabled "Olson" Timezone Database Version 2009.10 Timezone
Database internal Default timezone America/New_York
 DirectiveLocal ValueMaster Value date.default_latitude31.766731.7667
date.default_longitude35.25.2333 date.sunrise_zenith90.5890.58
date.sunset_zenith90.5890.58 date.timezone*no value**no value*

-- 
John Corry
PHP developer - 3by400, Inc
http://www.3by400.com