php-general Digest 29 Dec 2008 12:39:22 -0000 Issue 5871

2008-12-29 Thread php-general-digest-help

php-general Digest 29 Dec 2008 12:39:22 - Issue 5871

Topics (messages 285171 through 285191):

Re: What does ?xml have to do with it?
285171 by: tedd

Re: system() Question
285172 by: Daniel Brown
285174 by: Nathan Nobbe
285178 by: Micah Gersten
285179 by: Nathan Nobbe

Re: is_readable(http:// text file) says not, but I can in browser
285173 by: Daniel Brown

Re: Read Form values prior to submit?
285175 by: Manuel Lemos

Re: turn shared hosting server to external image storage hosting
285176 by: Manuel Lemos
285177 by: Nathan Nobbe

Re: Architecture patterns in PHP
285180 by: Manuel Lemos
285181 by: Carlos Medina
285182 by: Nathan Nobbe

Re: imap_rfc822_parse_adrlist problem
285183 by: ceo.l-i-e.com

Re: Segmentation fault in php5-imap
285184 by: ceo.l-i-e.com

Re: Problem with fetching values...
285185 by: Michelle Konzack
285188 by: Larry Garfield
285191 by: chris smith

Re: Where I can find the PHP5 grammar/specification?
285186 by: ceo.l-i-e.com

Offline PDO documentation?
285187 by: Michelle Konzack
285189 by: chris smith
285190 by: Michelle Konzack

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

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


--
---BeginMessage---

At 6:06 PM + 12/28/08, Benjamin Hawkes-Lewis wrote:

On 28/12/08 16:47, Jim Lucas wrote:
short tags are enabled.  Disable them in your php.ini file and you 
will be good.


Alternately:

?php
echo '?xml version=1.0 encoding=UTF-8 ?';
?

--
Benjamin Hawkes-Lewis


Bingo -- we have a winner!

Thanks Benjamin -- that works without me having to fix the short tag 
in the php init file, which I'm really fuzzy about doing anyway.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com
---End Message---
---BeginMessage---
On Sun, Dec 28, 2008 at 18:10, Rick Pasotto r...@niof.net wrote:

 You overlooked the ampersand in front of $retval. The syntax for
 'system' is:

 string system  ( string $command  [, int $return_var  ] )

 You have to pass a pointer to the variable, not the variable itself.

Actually, that's not entirely correct while the documentation
shows it as a reference variable, it's not actually required to be a
pointer.  And in either case, the OP had the error code returned
(127), and $retval would have nothing to do with causing the error.

What I would recommend trying is:

?php
exec('./gpsbabel -p  -r -t -i gpx -f test.gpx -o kml -F
test2.kml 21',$ret);
print_r($ret);
?

On a side note, I'm curious as to what 'gpsbabel' does.  I've
worked a bit with Keyhole markups and GIS overlays, etc.  Neat stuff.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
---End Message---
---BeginMessage---
On Sun, Dec 28, 2008 at 6:49 PM, Daniel Brown danbr...@php.net wrote:

 On Sun, Dec 28, 2008 at 18:10, Rick Pasotto r...@niof.net wrote:
 
  You overlooked the ampersand in front of $retval. The syntax for
  'system' is:
 
  string system  ( string $command  [, int $return_var  ] )
 
  You have to pass a pointer to the variable, not the variable itself.

 Actually, that's not entirely correct while the documentation
 shows it as a reference variable, it's not actually required to be a
 pointer.


good point dan, and just to add further clarification, thats b/c the
function specifies $return_var is passed by reference in the formal
parameter.  when you include the  along w/ an actual parameter (during
function invocation) thats referred to as call-time-pass-by-reference in
php, and its typically frowned upon.  in fact, i think its being removed
from a future version of php.

-nathan
---End Message---
---BeginMessage---
Nathan Nobbe wrote:
 good point dan, and just to add further clarification, thats b/c the
 function specifies $return_var is passed by reference in the formal
 parameter.  when you include the  along w/ an actual parameter (during
 function invocation) thats referred to as call-time-pass-by-reference in
 php, and its typically frowned upon.  in fact, i think its being removed
 from a future version of php.

 -nathan

   
You don't call system using the ampersand.  The reference is declared in
the function definition.  There's no reason for this to be frowned
upon.   What you are referring to is the old PHP4 style of explicit
pass-by-reference in function usage which is frowned upon.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com

---End Message---
---BeginMessage---
On 

php-general Digest 30 Dec 2008 01:52:38 -0000 Issue 5872

2008-12-29 Thread php-general-digest-help

php-general Digest 30 Dec 2008 01:52:38 - Issue 5872

Topics (messages 285192 through 285220):

mysql question
285192 by: ann kok
285194 by: Phpster

Re: Problem with fetching values...
285193 by: Michelle Konzack
285195 by: Eric Butera

Re: imap_rfc822_parse_adrlist problem
285196 by: Ben Stuyts

Search functionality in website.
285197 by: Tiji varghese
285198 by: Miles Thompson
285199 by: John Corry
285200 by: Richard Heyes
285213 by: tedd

Php mysql update
285201 by: admin.buskirkgraphics.com
285202 by: Gautier Di Folco
285203 by: John Corry
285204 by: admin.buskirkgraphics.com

Need Help
285205 by: dlinden
285206 by: Eric Butera
285208 by: John Corry

Help debugging a file upload on IIS
285207 by: Brian Dunning
285210 by: Ashley Sheridan
285212 by: Ashley Sheridan
285215 by: Brian Dunning
285218 by: Ashley Sheridan

Re: Need Help - apology
285209 by: John Corry
285211 by: Eric Butera

POSIX 1003.1-2001 gethostname(2)
285214 by: Brian A. Seklecki
285216 by: Daniel Brown

running python in php timeout
285217 by: brad
285220 by: Lars Torben Wilson

Re: Architecture patterns in PHP
285219 by: Manuel Lemos

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

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


--
---BeginMessage---
Hi all

Do you know any websites for mysql question?

I do submit the mysql forum but I would like to have more to learn

Now I have mysql replication question.

Thank you


  __
Ask a question on any topic and get answers from real people. Go to Yahoo! 
Answers and share what you know at http://ca.answers.yahoo.com

---End Message---
---BeginMessage---
The mysql forum is the best place. Note that their holiday schedule  
may mean some lag in getting answers.


Bastien

Sent from my iPod

On Dec 29, 2008, at 7:51 AM, ann kok oiyan...@yahoo.ca wrote:


Hi all

Do you know any websites for mysql question?

I do submit the mysql forum but I would like to have more to learn

Now I have mysql replication question.

Thank you


  
__
Ask a question on any topic and get answers from real people. Go to  
Yahoo! Answers and share what you know at http://ca.answers.yahoo.com



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

---End Message---
---BeginMessage---
Am 2008-12-29 22:09:16, schrieb chris smith:
  So, PostgreSQL catch the array by name
 
 pg_fetch_array($db_query, null, PGSQL_ASSOC)
 
  and MySQL use the position
 
 mysql_fetch_array($db_query, MYSQL_NUM)
 
 Why?
 
 http://www.php.net/mysql_fetch_array
 
 Use MYSQL_ASSOC as the 2nd param, or leave it out and by default it
 uses BOTH.

Argh!!! Asshole !!! (me)  --  I have not seen the tree in the wood!

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


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
http://www.tamay-dogan.net/   http://www.can4linux.org/
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature
---End Message---
---BeginMessage---
On Mon, Dec 29, 2008 at 7:57 AM, Michelle Konzack
linux4miche...@tamay-dogan.net wrote:
 Am 2008-12-29 22:09:16, schrieb chris smith:
  So, PostgreSQL catch the array by name
 
 pg_fetch_array($db_query, null, PGSQL_ASSOC)
 
  and MySQL use the position
 
 mysql_fetch_array($db_query, MYSQL_NUM)

 Why?

 http://www.php.net/mysql_fetch_array

 Use MYSQL_ASSOC as the 2nd param, or leave it out and by default it
 uses BOTH.

 Argh!!! Asshole !!! (me)  --  I have not seen the tree in the wood!

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


 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant #
 http://www.tamay-dogan.net/   http://www.can4linux.org/
 Michelle Konzack   Apt. 917  ICQ #328449886
 +49/177/935194750, rue de Soultz MSN LinuxMichi
 +33/6/61925193 67100 Strasbourg/France   

[PHP] Re: Segmentation fault in php5-imap

2008-12-29 Thread ceo

Perhaps compile everything in debug versions and get some core dumps and file a 
bug report at http://bugs.php.net/



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



[PHP] Re: Problem with fetching values...

2008-12-29 Thread Michelle Konzack
Am 2008-12-28 16:11:15, schrieb Nathan Nobbe:
 OK.  i would stop right there and ask yourself why..  there are tons of
 stable, working solutions out there that already do this, most notably for
 php5, PDO,
 
 http://us.php.net/manual/en/pdo.drivers.php
 
 which btw, is written in C ;)

I have tried to test it...

The problem is now, that none of my 4 Hosting provider support it.  :-/

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


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
http://www.tamay-dogan.net/   http://www.can4linux.org/
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Where I can find the PHP5 grammar/specification?

2008-12-29 Thread ceo

The PHP source uses bison/flex, I believe, so that's your best bet for finding 
the grammar.



Chris Shifflet (sp?) mentioned the other day somewhere that he was considering 
soon releasing some code that he uses in security audits for the boring grunt 
work part.



You may want to try to follow up with him.



He'd certainly be interested in your work, almost for sure, even if he missed 
your message due to holiday schedules.



[I'm replying rather late for that reason myself...]



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



[PHP] Offline PDO documentation?

2008-12-29 Thread Michelle Konzack
Hello,

In my PHP5 documetation I have installed on my system PDO is  mentioned,
but the files are missing...

While surfing php.net I have not found the PDO part which I need  Off-
Line since I am on GSM and surfing/searchin the  internet  is  sometimes
the hell.

Can someone point me to the tar archive for the PDO documentation please?

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


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
http://www.tamay-dogan.net/   http://www.can4linux.org/
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Re: Problem with fetching values...

2008-12-29 Thread Larry Garfield
On Monday 29 December 2008 2:26:46 am Michelle Konzack wrote:
 Am 2008-12-28 16:11:15, schrieb Nathan Nobbe:
  OK.  i would stop right there and ask yourself why..  there are tons of
  stable, working solutions out there that already do this, most notably
  for php5, PDO,
 
  http://us.php.net/manual/en/pdo.drivers.php
 
  which btw, is written in C ;)

 I have tried to test it...

 The problem is now, that none of my 4 Hosting provider support it.  :-/

Then you seriously need new hosting providers.  PDO is part of the standard 
install for PHP5, and there is simply no excuse for a web host to not support 
it.  You can try contacting them first to ask them to enable it, and if they 
say no, you say go away.  Really, that's simply irresponsible on their part.

-- 
Larry Garfield
la...@garfieldtech.com

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



Re: [PHP] Offline PDO documentation?

2008-12-29 Thread chris smith
On Mon, Dec 29, 2008 at 6:28 PM, Michelle Konzack
linux4miche...@tamay-dogan.net wrote:
 Hello,

 In my PHP5 documetation I have installed on my system PDO is  mentioned,
 but the files are missing...

 While surfing php.net I have not found the PDO part which I need  Off-
 Line since I am on GSM and surfing/searchin the  internet  is  sometimes
 the hell.

 Can someone point me to the tar archive for the PDO documentation please?

You can download the whole php.net docs:

http://www.php.net/download-docs.php

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

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



[PHP] Re: Offline PDO documentation?

2008-12-29 Thread Michelle Konzack
Am 2008-12-29 20:08:40, schrieb chris smith:
 You can download the whole php.net docs:
 
 http://www.php.net/download-docs.php

Grrr, while I was checking which version I have on my intranet server, I
have encountered it was the one from 2007-05-01...  and  a  newer  TAR
Archive was laying arround and never extracted!  :-/

However, I have installed the latest one from 2008-12-26 downloaded
for one minute...  Great, it was fresh uploaded for 3 days...

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


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
http://www.tamay-dogan.net/   http://www.can4linux.org/
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Problem with fetching values...

2008-12-29 Thread chris smith
 So, PostgreSQL catch the array by name

pg_fetch_array($db_query, null, PGSQL_ASSOC)

 and MySQL use the position

mysql_fetch_array($db_query, MYSQL_NUM)

Why?

http://www.php.net/mysql_fetch_array

Use MYSQL_ASSOC as the 2nd param, or leave it out and by default it uses BOTH.

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

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



[PHP] mysql question

2008-12-29 Thread ann kok
Hi all

Do you know any websites for mysql question?

I do submit the mysql forum but I would like to have more to learn

Now I have mysql replication question.

Thank you


  __
Ask a question on any topic and get answers from real people. Go to Yahoo! 
Answers and share what you know at http://ca.answers.yahoo.com


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



[PHP] Re: Problem with fetching values...

2008-12-29 Thread Michelle Konzack
Am 2008-12-29 22:09:16, schrieb chris smith:
  So, PostgreSQL catch the array by name
 
 pg_fetch_array($db_query, null, PGSQL_ASSOC)
 
  and MySQL use the position
 
 mysql_fetch_array($db_query, MYSQL_NUM)
 
 Why?
 
 http://www.php.net/mysql_fetch_array
 
 Use MYSQL_ASSOC as the 2nd param, or leave it out and by default it
 uses BOTH.

Argh!!! Asshole !!! (me)  --  I have not seen the tree in the wood!

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


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
http://www.tamay-dogan.net/   http://www.can4linux.org/
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] mysql question

2008-12-29 Thread Phpster
The mysql forum is the best place. Note that their holiday schedule  
may mean some lag in getting answers.


Bastien

Sent from my iPod

On Dec 29, 2008, at 7:51 AM, ann kok oiyan...@yahoo.ca wrote:


Hi all

Do you know any websites for mysql question?

I do submit the mysql forum but I would like to have more to learn

Now I have mysql replication question.

Thank you


  
__
Ask a question on any topic and get answers from real people. Go to  
Yahoo! Answers and share what you know at http://ca.answers.yahoo.com



--
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] Re: Problem with fetching values...

2008-12-29 Thread Eric Butera
On Mon, Dec 29, 2008 at 7:57 AM, Michelle Konzack
linux4miche...@tamay-dogan.net wrote:
 Am 2008-12-29 22:09:16, schrieb chris smith:
  So, PostgreSQL catch the array by name
 
 pg_fetch_array($db_query, null, PGSQL_ASSOC)
 
  and MySQL use the position
 
 mysql_fetch_array($db_query, MYSQL_NUM)

 Why?

 http://www.php.net/mysql_fetch_array

 Use MYSQL_ASSOC as the 2nd param, or leave it out and by default it
 uses BOTH.

 Argh!!! Asshole !!! (me)  --  I have not seen the tree in the wood!

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


 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant #
 http://www.tamay-dogan.net/   http://www.can4linux.org/
 Michelle Konzack   Apt. 917  ICQ #328449886
 +49/177/935194750, rue de Soultz MSN LinuxMichi
 +33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


FWIW you can also use mysql_fetch_assoc

http://us2.php.net/mysql_fetch_assoc

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



Re: [PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-29 Thread Ben Stuyts

Hi,

On 29 dec 2008, at 08:57, c...@l-i-e.com wrote:


File a bug report at
http://bugs.php.net

You have a pretty clear-cut case of a built-in function gone awry,  
and it will probably be fixed pretty fast.


I also rely on this function quite a bit, so it needs to work right  
when I end up at 5.2.8 some day :-)


I already did that: http://bugs.php.net/bug.php?id=46918
and it has been fixed by fel...@php.net: This bug has been fixed in  
CVS. (Thanks!).


I was trying to find out if a 5.2.9 release is imminent, but I can't  
seem to find any sort of roadmap. I'm using php from the ports system  
in FreeBSD, so using CVS would mean going around that.



On 21 dec 2008, at 03:41, Manuel Lemos wrote:


on 12/20/2008 09:34 PM Ben Stuyts said the following:

Hi,

Since upgrading to php 5.2.8 I have a problem with
imap_rfc822_parse_adrlist. When I run the example given on the  
manual

page at http://nl3.php.net/imap_rfc822_parse_adrlist:
...
So the host part isn't filled in correctly. I have verified this on
two
FreeBSD 7 machines. On an older FreeBSD 5 machine with php4 this
works
fine. Before the update, I was running php 5.2.6 and there was no
problem either. Any ideas?


Sometime ago I decided to not use IMAP library functions to parse e-
mail
addresses because it was not handling all sorts of addresses as it
should.


Ben


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



[PHP] Search functionality in website.

2008-12-29 Thread Tiji varghese
Hi all,I would like to set up search functionality on my website. I'm using PHP 
and Mysql. Most of the pages contain static text in the html and is not 
database driven. I need some idea on how should I go about it without moving 
everything to database driven functionality. Please help.Thanks in advance! 


  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Re: [PHP] Search functionality in website.

2008-12-29 Thread Miles Thompson
On Mon, Dec 29, 2008 at 10:47 AM, Tiji varghese tij...@yahoo.co.in wrote:

 Hi all,I would like to set up search functionality on my website. I'm using
 PHP and Mysql. Most of the pages contain static text in the html and is not
 database driven. I need some idea on how should I go about it without moving
 everything to database driven functionality. Please help.Thanks in advance!


  Add more friends to your messenger and enjoy! Go to
 http://messenger.yahoo.com/invite/


ht-dig (or digg)


Re: [PHP] Search functionality in website.

2008-12-29 Thread John Corry
Or even a google search widget...

Miles Thompson wrote:
 On Mon, Dec 29, 2008 at 10:47 AM, Tiji varghese tij...@yahoo.co.in wrote:

 ht-dig (or digg)
 

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



Re: [PHP] Search functionality in website.

2008-12-29 Thread Richard Heyes
 Hi all,I would like to set up search functionality on my website. I'm using 
 PHP and Mysql. Most
 of the pages contain static text in the html and is not database driven. I 
 need some idea on how
 should I go about it without moving everything to database driven 
 functionality.

You could look into using Zend_Search_Lucene (part of the Zend
framework). Never used it myself, but from what I've read about it, it
looks quite good (plus it's file based, ie. you don't need MySQL).
There's also the Google search widget like I use on my personal
website: http://www.phpguru.org

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 20th)

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



[PHP] Php mysql update

2008-12-29 Thread admin
Okay maybe i have just forgot.
I am trying to update the database and do a +1 to a int field without pulling 
the data and adding 1 to it and sticking it back in.

Someone refresh me on this please.
I think it is something like.
$dwsl = mysql_query(UPDATE database set Field='+1' WHERE Criteria='Criteria');

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



RE: [PHP] Php mysql update

2008-12-29 Thread Gautier Di Folco

Hello, you have to do :
$dwsl = mysql_query('UPDATE database SET Field=Field+1 WHERE 
Criteria=\'Criteria\''); From: ad...@buskirkgraphics.com To: 
php-general@lists.php.net Date: Mon, 29 Dec 2008 12:05:37 -0500 Subject: 
[PHP] Php mysql update  Okay maybe i have just forgot. I am trying to update 
the database and do a +1 to a int field without pulling the data and adding 1 
to it and sticking it back in.  Someone refresh me on this please. I think 
it is something like. $dwsl = mysql_query(UPDATE database set Field='+1' 
WHERE Criteria='Criteria');  --  PHP General Mailing List 
(http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php 
_
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp

Re: [PHP] Php mysql update

2008-12-29 Thread John Corry
Wouldn't it be:
mysql_query(UPDATE database set Field = Field+1 WHERE
Criteria='Criteria');

Note: no '' around +1, = operator

John Corry

ad...@buskirkgraphics.com wrote:
 Okay maybe i have just forgot.
 I am trying to update the database and do a +1 to a int field without pulling 
 the data and adding 1 to it and sticking it back in.
 
 Someone refresh me on this please.
 I think it is something like.
 $dwsl = mysql_query(UPDATE database set Field='+1' WHERE 
 Criteria='Criteria');
 

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



RE: [PHP] Php mysql update

2008-12-29 Thread admin
Sorry about that it hit me right after i sent the email.
Thank You so much for you reply


Hello, you have to do :
$dwsl = mysql_query('UPDATE database SET Field=Field+1 WHERE 
Criteria=\'Criteria\''); From: ad...@buskirkgraphics.com To: 
php-general@lists.php.net Date: Mon, 29 Dec 2008 12:05:37 -0500 Subject: 
[PHP] Php mysql update  Okay maybe i have just forgot. I am trying to update 
the database and do a +1 to a int field without pulling the data and adding 1 
to it and sticking it back in.  Someone refresh me on this please. I think 
it is something like. $dwsl = mysql_query(UPDATE database set Field='+1' 
WHERE Criteria='Criteria');  --  PHP General Mailing List 
(http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php 
_
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp

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



[PHP] Need Help

2008-12-29 Thread dlinden
I am getting this error and can't resolve;

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
boolean given in /home5/camfulco/public_html/CompanyHome.php on line 132

code listing follows;

?php
  /* Program: CompanyHome.php
   * Desc:Displays a Web page that has four levels:
   *  1) the home page, 2) a department page, 3) a
   *  content list page, and 4) a detail page.
   */
if (!isset($_SESSION))   #7
  session_start();

include_once(functions_main.inc);

$page = array(   #12
  title  = The Company Intranet,
  header = The Company Intranet,
  bottom = Copyright(R) 2005,
  left_nav_links = array(),
  body_links = array(),
  col_headers= array(),
  data_rows  = array(),
);

$admin = FALSE;
$base_url = CompanyHome.php;
$trail = a href='$base_url'Home/a;#24

if (!isset($_SESSION['user_name']))
  header(Location: Login.php);#27
else
{
  if (isset($_SESSION['user_dept'])
   isset($_GET['dept_id']))
  { #32
$admin = $_SESSION['user_dept'] == $_GET['dept_id'];
  }

  $cxn = Connect_to_db(Vars.inc);
  $left_nav_links = array();
  $page[browse_level] =   #38
isset($_GET['browse_level']) ?
  $_GET['browse_level'] : home;   

  switch ($page[browse_level])#42
  {
case home:
  $sql = SELECT name, dept_id, description
  FROM Department
  ORDER BY name;
  $results = mysqli_query($cxn, $sql);
  $body_links = ;
  while($row = mysqli_fetch_assoc($results))#50
  {
$link = $base_url?dept_id= . $row['dept_id']
  . browse_level=department;
$page[left_nav_links][$link] = $row['name'];
$body_links .= lia href=\ . $link
  . \ . $row['name'] . /a - 
  . $row['description'];
  }
  $page[left_nav_header] = Departments; #59
  $page[top] = Welcome to our Intranet;
  $page[body_text] = Welcome to our Intranet 
. where each department shares content with 
. the whole company.  You can update your 
. own departments content too with our simple 
. interface.pVist the departments' 
. home pages: $body_links;

  break;

case department:  #70
  $dept_id = $_GET['dept_id'];
  $sql = SELECT name, dept_id, description
  FROM Department
  WHERE dept_id = $dept_id ORDER BY name;
  $results = mysqli_query($cxn, $sql);
  $row = mysqli_fetch_assoc($results);
  $dept_name = $row['name'];
  $dept_desc= $row['description'];

  $page[left_nav] = $dept_name Content;
  $page[body_text] = $dept_name - $dept_desc;
  $sql = SELECT a.name, a.type_id,
 count(b.content_id)
  FROM Content_Type a
  LEFT OUTER JOIN Content b on
   a.type_id = b.content_type
   and b.dept_id = $dept_id
  GROUP BY a.name, a.type_id ORDER BY name;
  $results = mysqli_query($cxn, $sql);

  $body_links = ;
  while($row = mysqli_fetch_assoc($results))#92
  {
$link = $base_url?dept_id=$dept_id
  . type_id= . $row['type_id']
  . browse_level=content;
$page[left_nav_links][$link] = $row['name'];
$body_links .= lia href=\ . $link
  . \ . $row['name'] . /a;
  }
  $page[left_nav_header] = Content Index;
  $page[top] = $dept_name;
  $page[body_text] = $dept_name - $dept_desc 
. pVist the departments' 
. areas: $body_links;
  $trail .=  - a href='$base_url?dept_id=$dept_id
 .  browse_level=department'$dept_name/a;
  break;

case content:#110
  $dept_id = $_GET['dept_id'];
  $type_id = $_GET['type_id'];
  $sql = SELECT a.name, a.type_id, b.title,
b.description, b.content_date,
b.create_date, b.created_by,
b.last_upd_date, b.last_upd_by,
c.name as dept_name, content_id
  FROM Content_Type a, Department c
  LEFT OUTER JOIN Content b on
a.type_id = b.content_type
and a.type_id = b.content_type
and b.dept_id = $dept_id
and b.content_type = $type_id
  WHERE c.dept_id = $dept_id
  ORDER BY content_date DESC;
  $results = mysqli_query($cxn, $sql);

  $body_links = ;
  $content_count = 0;
  $page[body_text] = ;

  while($row = mysqli_fetch_assoc($results))   #132
  {
if (!isset($area_name)  $type_id == $row[type_id])
{
  $area_name = $row[name];
  $dept_name = $row[dept_name];
}
$link = $base_url?dept_id=$dept_id
  

Re: [PHP] Need Help

2008-12-29 Thread Eric Butera
On Mon, Dec 29, 2008 at 2:39 PM, dlinden dlin...@springtidepartners.com wrote:
 I am getting this error and can't resolve;

 Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
 boolean given in /home5/camfulco/public_html/CompanyHome.php on line 132


I'm not going to read all 500 lines of that, but I'm seeing your error
says boolean given.  Maybe your query failed and is false instead of a
resource.

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



[PHP] Help debugging a file upload on IIS

2008-12-29 Thread Brian Dunning
Hi - I have a file upload that returns no error, but the file does not  
appear on the server. Here is the result of $_FILES:


Array (
[f] = Array (
[name] = Elephants.pdf
[type] = application/pdf
[tmp_name] = C:\WINDOWS\Temp\php3133.tmp
[error] = 0
[size] = 114109 ) )

Nothing new at all in C:\Windows\Temp\. PHP is properly putting its  
session files in there, so I know PHP has permission. Anyway I set  
Everyone permissions to Full Control for that directory. post_max_size  
and upload_max_filesize are both 250M. Just not sure what else to check.


PHP 5.2.6, Microsoft-IIS/6.0, Windows 2003 Server R2, Enterprise  
Edition, SP2


Thanks.

Re: [PHP] Need Help

2008-12-29 Thread John Corry
1. It's generally considered poor etiquette to send that much code to a
mailing list. How about snipping the relevant section next time?

2. the error says: mysqli_fetch_assoc() expects parameter 1 to be
mysqli_result. There's your clue. Is the query good? Is the connection good?

I'm getting a little dismayed here lately at how many people are posting
to this list who don't have a clue and aren't willing to even TRY to get
a clue before asking for help from someone else.

Tracking down errors like this, function by function, is how you LEARN
this stuff.

Please do yourself (and everyone else on the list) a favor and do at
least just even a MODEST amount of research before sending your hundreds
of lines of crappy code out to the ether asking someone to fix it for you!

John

PS - sorry if that's not soft and sensitive enough. Where I come from
(vintage late 90s self-educated programmer), you didn't DARE ask for
help until you could demonstrate to everyone you were asking that you
had done your homework on the problem, researched the relevant
functions/error messages, tried some tests doing something similar, run
the query to make sure it's good...basically everything you COULD do to
debug your own mess.


dlinden wrote:
 I am getting this error and can't resolve;
 
 Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
 boolean given in /home5/camfulco/public_html/CompanyHome.php on line 132
 
 code listing follows;

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



Re: [PHP] Need Help - apology

2008-12-29 Thread John Corry

That was too heavy handed.

I'm sorry. Please forgive my harshness.

John

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



Re: [PHP] Help debugging a file upload on IIS

2008-12-29 Thread Ashley Sheridan
On Mon, 2008-12-29 at 11:54 -0800, Brian Dunning wrote:
 Hi - I have a file upload that returns no error, but the file does not  
 appear on the server. Here is the result of $_FILES:
 
 Array (
   [f] = Array (
   [name] = Elephants.pdf
   [type] = application/pdf
   [tmp_name] = C:\WINDOWS\Temp\php3133.tmp
   [error] = 0
   [size] = 114109 ) )
 
 Nothing new at all in C:\Windows\Temp\. PHP is properly putting its  
 session files in there, so I know PHP has permission. Anyway I set  
 Everyone permissions to Full Control for that directory. post_max_size  
 and upload_max_filesize are both 250M. Just not sure what else to check.
 
 PHP 5.2.6, Microsoft-IIS/6.0, Windows 2003 Server R2, Enterprise  
 Edition, SP2
 
 Thanks.
Are you sure that it is using the same temp directory as it is for the
sessions?


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Need Help - apology

2008-12-29 Thread Eric Butera
On Mon, Dec 29, 2008 at 3:18 PM, John Corry jco...@gmail.com wrote:

 That was too heavy handed.

 I'm sorry. Please forgive my harshness.

 John

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



Having a bad day at work? ;)

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



Re: [PHP] Help debugging a file upload on IIS

2008-12-29 Thread Ashley Sheridan
On Mon, 2008-12-29 at 20:34 +, Ashley Sheridan wrote:
 On Mon, 2008-12-29 at 11:54 -0800, Brian Dunning wrote:
  Hi - I have a file upload that returns no error, but the file does not  
  appear on the server. Here is the result of $_FILES:
  
  Array (
  [f] = Array (
  [name] = Elephants.pdf
  [type] = application/pdf
  [tmp_name] = C:\WINDOWS\Temp\php3133.tmp
  [error] = 0
  [size] = 114109 ) )
  
  Nothing new at all in C:\Windows\Temp\. PHP is properly putting its  
  session files in there, so I know PHP has permission. Anyway I set  
  Everyone permissions to Full Control for that directory. post_max_size  
  and upload_max_filesize are both 250M. Just not sure what else to check.
  
  PHP 5.2.6, Microsoft-IIS/6.0, Windows 2003 Server R2, Enterprise  
  Edition, SP2
  
  Thanks.
 Are you sure that it is using the same temp directory as it is for the
 sessions?
 
 
 Ash
 www.ashleysheridan.co.uk
 
 
Sorry, that's a silly question, ignore that. As far as I'm aware, IIS
removes the files once the script has run it's course; so unless you're
doing something with the file in your code, you won't really see it.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Search functionality in website.

2008-12-29 Thread tedd

At 8:17 PM +0530 12/29/08, Tiji varghese wrote:
Hi all,I would like to set up search functionality on my website. 
I'm using PHP and Mysql. Most of the pages contain static text in 
the html and is not database driven. I need some idea on how should 
I go about it without moving everything to database driven 
functionality. Please help.Thanks in advance!


Try:

http://sperling.com/examples/search/

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



[PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread Brian A. Seklecki


All:

Is anyone interested in adding POSIX 1003.1-2001 gethostname(2) support? I'm 
interested in sponsoring a small contract development initiative.


I need something more reliable than $_ENV[].   Not all shells export $HOSTNAME 
by default.


~BAS

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



Re: [PHP] Help debugging a file upload on IIS

2008-12-29 Thread Brian Dunning

The one thing I was doing was:
move_uploaded_file($_FILES['upload_file']['tmp_name'], $new_path);

but nothing was happening, no new file appearing where it was supposed  
to, and no error returned, left me scratching my head. (Later the same  
script logs the upload to MySQL using data from $_FILES and that part  
works fine.)


On Dec 29, 2008, at 12:43 PM, Ashley Sheridan wrote:


Sorry, that's a silly question, ignore that. As far as I'm aware, IIS
removes the files once the script has run it's course; so unless  
you're

doing something with the file in your code, you won't really see it.




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



Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread Daniel Brown
On Mon, Dec 29, 2008 at 16:26, Brian A. Seklecki
laval...@spiritual-machines.org wrote:

 All:

 Is anyone interested in adding POSIX 1003.1-2001 gethostname(2) support? I'm
 interested in sponsoring a small contract development initiative.

 I need something more reliable than $_ENV[].   Not all shells export
 $HOSTNAME by default.

Brian,

As you most likely mean the core engine, Brian, this email is
being forwarded to the Internals mailing list.  If you haven't
already, please consider subscribing to that list by sending a blank
email to intern...@lists.php.net.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



[PHP] running python in php timeout

2008-12-29 Thread brad

Hi,

I'm executing a python script from php that runs quite a long time (15+ 
minutes) and ends up timing out. Is there a way I can execute the python 
code and move on executing the remaining php code on the page?

Thanks!

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



Re: [PHP] Help debugging a file upload on IIS

2008-12-29 Thread Ashley Sheridan
On Mon, 2008-12-29 at 13:29 -0800, Brian Dunning wrote:
 The one thing I was doing was:
 move_uploaded_file($_FILES['upload_file']['tmp_name'], $new_path);
 
 but nothing was happening, no new file appearing where it was supposed  
 to, and no error returned, left me scratching my head. (Later the same  
 script logs the upload to MySQL using data from $_FILES and that part  
 works fine.)
 
 On Dec 29, 2008, at 12:43 PM, Ashley Sheridan wrote:
 
  Sorry, that's a silly question, ignore that. As far as I'm aware, IIS
  removes the files once the script has run it's course; so unless  
  you're
  doing something with the file in your code, you won't really see it.
 
 
 
Does the script have permission to write the file to the new directory?
What value is returned from attempting this? Just assign that
move_uploaded_file line to a variable and print the output.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Manuel Lemos
Hello,

on 12/27/2008 10:57 PM Murray said the following:
 I'm interested in this topic as well. I'm starting out on a reasonably large
 web application, and I'm wondering at the best approach in PHP, particularly
 since it's been some years since I worked with PHP on a daily basis (the
 last 5 years have been purely C#).
 
 There's some dev community bias against using frameworks, isn't there? On
 one hand I'd love to take an approach that would make my end goal easier
 (thanks for pointing out Code Igniter, I'll look into it further), but on
 the other hand I'd rather avoid choices that 'tainted' (perhaps not the
 right word, but the best I could think of) the overall acceptance of the
 application once it's ready for release.

I would not say there is bias against frameworks, but rather that there
is no consensual around a specific framework. Some people prefer one
framework, other people prefer others. Some people prefer relying on
code written by themselves, others prefer using ready to code provided
by others.

One thing is certain, if you adopt a framework, you need to invest time
learning how to use it. Some frameworks are not easy to learn and you
end up spending more time than you wanted.

Here is a longer reflection about using frameworks in PHP:

http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html


 So, currently I'm wondering about things like, 'Do I make an app that is a
 distinct page-per-function, or do I make an app that uses a monolithic
 index.php (similar to Wordpress?) and dynamically presents
 *everything*based on querystring values.'

Personally I prefer to separate in different pages. It helps making
things more organized.

To sort out things that are more organized, some people use frameworks
to help parsing URL parameters and route requests to different
application modules.

If you separate things, you do not need to build or learn any framework
to handle things separately.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] running python in php timeout

2008-12-29 Thread Lars Torben Wilson
2008/12/29 brad bradcau...@gmail.com:
 Hi,

 I'm executing a python script from php that runs quite a long time (15+
 minutes) and ends up timing out. Is there a way I can execute the python
 code and move on executing the remaining php code on the page?
 Thanks!

Hi Brad,

It's a little tough to say for sure since you didn't specify your OS
or platform (always good info to include), but if you're on *nix then
you'll need to tell the child process to run in the background and
redirect the output from the child process to somewhere else (say, a
log file). You also didn't say how you're executing the child process,
but here's a common way to do it using backticks:

`/path/to/executable $arg1 $arg2  /path/to/logfile.log 21 `

The ' /path/to/logfile.log' redirects standard output from the
process to your log file. The '21' following that redirects the
process's standard error to its standard output (which means that
error messages will also be written to the log file), and the final
ampersand puts the child process into the background.

The same technique also works with exec() etc.


Torben

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



Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Sancar Saran
On Sunday 28 December 2008 01:40:01 Michael C. Yates wrote:
 Hey,

 How do you structure your web applications? I am thinking in terms of
 separating presentation  and logic. How is that done in PHP? And how
 many architecture patterns are there?


 Thanks


 Micheal C. Yates


Well,

I use, way of Rasmus (I give that name)

and please read this why

http://talks.php.net/show/drupal08/0

regards

Sancar


Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Manuel Lemos
Hello,

on 12/30/2008 01:13 AM Sancar Saran said the following:
 How do you structure your web applications? I am thinking in terms of
 separating presentation  and logic. How is that done in PHP? And how
 many architecture patterns are there?
 
 
 Well,
 
 I use, way of Rasmus (I give that name)
 
 and please read this why
 
 http://talks.php.net/show/drupal08/0

After you watch that presentation, the conclusion that you reach is if
you want to develop a site that only shows a page saying Hello world!
you should not use an MVC framework because it adds to much performance
overhead! ;-)

Seriously, real world projects are way much more complex than simple
Hello world! pages.

Personally I do no use MVC frameworks (nor I have developed one) because
they just add unnecessary complexity.

However, separating concerns (processing, presentation, model data
storage, distributed services, etc...) is a good thing to help keeping
the project organization (and your mental sanity) as you project grows.

You can separate concerns without using MVC, especial front controllers
that go through many hops to sort which code to execute.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] turn shared hosting server to external image storage hosting

2008-12-29 Thread paragasu
i tried to ping photobucket. it takes 400ms for here. i only want to
create a small gallery locally. our ISP have a very slow connection
outside our country. so i want to take advantage of any available
server here.

cloudfront nearest server in asia is in hongkong. i try to look in to it.

On 12/28/08, Nathan Nobbe quickshif...@gmail.com wrote:
 On Sun, Dec 28, 2008 at 6:37 AM, paragasu parag...@gmail.com wrote:

 do you have any idea how to do this. i have a small vps about 10GB
 space. i live somewhere is south east asia where solutions like Amazon
 S3 is incredibly slow. (500ms ping time).

 i have a simple php gallery. But dedicated server is quite expensive
 ($100/month). searching around, i found several local hosting
 companies provide a very cheap shared hosting. ($100 / year, 300GB).
 local server with 40ms ping time.

 i am interested to use that shared hosting just as storage for images
 of my gallery and a cheap vps to store the database.

 What is the best way for me to accomplish this? Amazon S3 using REST
 etc. Is it possible to write a simple storage (REST system) like
 amazon s3 in PHP? is there anyone wrote this before. I am interested
 in your solutions..


 have you tried photobucket ?  we have an api in php which is freely
 available and we use a CDN for caching all around the globe.  in fact, id be
 interested to find out how it stacks up over there, in your neck of the
 woods.

 -nathan


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



Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Daniel Kolbo

Michael C. Yates wrote:

Hey,

How do you structure your web applications? I am thinking in terms of 
separating presentation  and logic. How is that done in PHP? And how 
many architecture patterns are there?



Thanks


Micheal C. Yates


I am an amateur programmer, so take my comments with a grain of salt (i 
haven't done heavy traffic long term projects).  Having read through 
this thread no one has of yet mentioned Smarty.net http://smarty.net/ .
Smarty is a template engine.  It allows presentation to be separated 
with logic.  I like it cuz my site designes usually end up looking like 
a 3rd grader designed it and you need some sorta special glasses to 
protect your eyes.  However, i can do some solid logic coding (query DBs 
and whatnot).  So smarty has been highly prized by me in my projects.  
But that is all i am doing is 'projects', those that usually lost 
money.  But this is not because of smarty.  Without smarty i wouldn't 
have even been able to get going.  Also, it cleans up the code if you 
stick to the division principles.

my USD 0.02$ which is a lot less now than it used to be... :(
dK


Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Nathan Nobbe
On Mon, Dec 29, 2008 at 9:05 PM, Manuel Lemos mle...@acm.org wrote:

 Hello,

 on 12/30/2008 01:13 AM Sancar Saran said the following:
  How do you structure your web applications? I am thinking in terms of
  separating presentation  and logic. How is that done in PHP? And how
  many architecture patterns are there?
 
 
  Well,
 
  I use, way of Rasmus (I give that name)
 
  and please read this why
 
  http://talks.php.net/show/drupal08/0

 After you watch that presentation, the conclusion that you reach is if
 you want to develop a site that only shows a page saying Hello world!
 you should not use an MVC framework because it adds to much performance
 overhead! ;-)


it also acts as a nice control mechanism to compare so many frameworks,
trivial php, and html.  really nice to see the numbers like that; so cake is
horrifically slow, solar  zend are pretty fast and code igniter is like
twice as fast as those.

i also like how rasmus shows several advanced optimization techniques, via
strace and gdb.  ive not used the 'included' extension, ill probly check it
out.  you know some of us yougin's never really got too much pratical
exposure to tools like that =/  im still ramping up on these low level
utilities myself.

-nathan


Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Manuel Lemos
Hello,

on 12/30/2008 05:07 AM Nathan Nobbe said the following:
 How do you structure your web applications? I am thinking in terms of
 separating presentation  and logic. How is that done in PHP? And how
 many architecture patterns are there?

 Well,

 I use, way of Rasmus (I give that name)

 and please read this why

 http://talks.php.net/show/drupal08/0
 After you watch that presentation, the conclusion that you reach is if
 you want to develop a site that only shows a page saying Hello world!
 you should not use an MVC framework because it adds to much performance
 overhead! ;-)

 
 it also acts as a nice control mechanism to compare so many frameworks,
 trivial php, and html.  really nice to see the numbers like that; so cake is
 horrifically slow, solar  zend are pretty fast and code igniter is like
 twice as fast as those.

I am not sure if that conclusion is correct. Were the benchmarks done
using a PHP cache extension? If not, the results may just show that Cake
 includes more code probably because it is more mature than others that
are younger.

What happens is that PHP code is compiled in zend opcode before
executing. The more code split in include files you load, more time it
spends loading the code before executing. When you use a PHP cache
extension, the compile phase is skipped and replaced by loading compiled
PHP code from cache. So most of the time is taken actually by executing
the code.

Therefore using the PHP cache extension may give more useful results to
compare framework execution overhead.


 i also like how rasmus shows several advanced optimization techniques, via
 strace and gdb.  ive not used the 'included' extension, ill probly check it
 out.  you know some of us yougin's never really got too much pratical
 exposure to tools like that =/  im still ramping up on these low level
 utilities myself.

Those may not be the best tools to tell you what PHP code is taking more
time to execute, as they only show system calls. There are PHP profiler
extension that give you a better vision of the actual PHP code that may
be slowing down things.

strace is more useful for PHP core developers as it tells which system
calls are more expensive and could be worth some optimization.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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