php-general Digest 27 Jun 2005 04:46:48 -0000 Issue 3535

Topics (messages 217651 through 217674):

Mail System Error - Returned Mail
        217651 by: Mail Administrator

Re: PHP vs. ColdFusion
        217652 by: Ke'tszeri Csaba
        217660 by: Jochem Maas
        217663 by: Jonathan Villa

Re: Stop spreading PEAR FUD; WAS Re: [PHP] Re: PHP web archeticture
        217653 by: M Saleh EG

snmpgetnext not working (get, walk and walkoid work fine)
        217654 by: kbapat.windwardcg.com

A Bug in string '<br><br> e<D'?
        217655 by: cchereTieShou
        217658 by: Martín Marqués
        217661 by: Jasper Bryant-Greene
        217664 by: Kevin L'Huillier
        217667 by: Jasper Bryant-Greene
        217669 by: Kevin L'Huillier
        217671 by: Jasper Bryant-Greene

the BACKSLASH
        217656 by: Jochem Maas
        217657 by: Sebastian
        217659 by: Martín Marqués

Re: including the result of one query in another query
        217662 by: Jasper Bryant-Greene

Re: PHP web archeticture
        217665 by: Greg Donald
        217666 by: Robert Cummings

PHP search
        217668 by: Bruce Gilbert

$mydata->StampDate
        217670 by: John Taylor-Johnston
        217672 by: Jasper Bryant-Greene
        217673 by: John Taylor-Johnston
        217674 by: Jasper Bryant-Greene

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---


--- End Message ---
--- Begin Message ---
Hello,

I can't give out exact numbers, but have worked for a portal in 2001 with around 100K page impressions per day. First they stared with cf, three massive, Intel based HP web servers and one SUN for the Oracle. The system hardly managed this load, so they fired the firm wrote the the CF, and rewritten all stuff in php4 to give it a try. After that, two servers were switched off, one with linux and php managed the load very well, so I assume that you may have to consider number of visitors per day, and the hardware requirements too.

About zend: sorry to say that here, but the less tools you use, the more freedom you have. Give me ssh access to any server running my php code and I can inspect it very well, may fix it in one shot :)). From anywhere.

More tecnically, like we were programmers: php offers several of its functions as a wrapping of low level system routines and native drivers. I can hardly imagine any app design to be more effective than this. If you are worried about code parsing, php accelerator may be just enough. ;)

Br,

Csaba Ketszeri

--- End Message ---
--- Begin Message ---
Rick Emery wrote:
My employer has (finally) decided to take full advantage of our intranet, and wants to move from client-server applications to web-based applications. To that end, we're trying to determine the best platform for our applications. We're a Microsoft shop, with Microsoft SQL Server 2000 for all of our databases (that won't change any time soon, if

what is special about the MSSQL2K servers? do you have a lot of stored
procedures in it? stuff like that?

ever). Due to past experience that I won't get into, we (the Development group) have all agreed that ASP.Net is out (at least for the short term).


if the MSSQL servers are so important/complex/big/etc then maybe ASP.not
is the right way to go? given that moving 'everything' from
client-server to web-baseed interfaces isn't really a short-term
operation. (assuming some level of complexity in the existing software.)

We had the opportunity to visit a local enterprise that has deployed ColdFusion, and they couldn't stop singing its praises. I'm partial to PHP, even after sampling Coldfusion, so what I would like is some "ammunition" that I can take into a meeting to "sell" management on PHP instead of ColdFusion. I've already been harping on the difference in cost, so I'm looking for other points to go with. Besides, we'll probably invest in Zend products if we choose PHP, and Macromedia has

like marcromedia tools are required to run CF, they 'tie you in' to
the technology. buying Zend products is optional, if the Zend IDE is judge to
be a moneysaving tool for working with PHP then you buy it. But you
don't have to. the essential tools are with out cost and open to inspection
and modification. Purchasing Zend Accelerator/Encoder maybe a good move
for you company but again its not a requirement.

from a strategic point of view it might also not be wise to make a
substanstial investment in technology from a company thats just been
bought out by the competion (adobe)?

government rates available; I don't have any numbers (yet), but the cost difference may not be that great in the end.

Any input would be greatly appreciated. Opinions are welcome (especially from programmers with experience in both), but I have to "sell" it to management (I'm already on the PHP side), so links to data or articles comparing the two are best.

Thanks in advance,
Rick

--- End Message ---
--- Begin Message ---
Take a look at these, they are just some of the articles I've bookmarked
over the past

Oracle is now behind (well in support of) PHP
http://www.oracle.com/technology/tech/php/index.html

IBM is also behind PHP (well in support of)
http://www-128.ibm.com/developerworks/websphere/techjournal/0505_krook/0505_krook.html
http://www-306.ibm.com/software/data/info/zendcore/pr.html

Microsoft looks to extenguish LAMP
http://news.com.com/Microsoft+looks+to+extinguish
+LAMP/2100-1012_3-5746549.html

Misc:
http://www.robertpeake.com/archives/66-Why-PHP.html
http://news.com.com/2061-10795_3-5663085.html

To be fair:
http://www.zdnet.com.au/news/software/0,2000061733,39193420,00.htm

If you're org decides to go PHP... there are all kinds of OpenSource
tools they can choose use which they can enhance for their
organization's specific needs

GForge
Mambo CMS
SugarCRM
and more...

GForge and SugarCRM also have paid support options as well.

-Jonathan Villa



On Mon, 2005-06-27 at 00:14 +0200, Jochem Maas wrote:
> Rick Emery wrote:
> > My employer has (finally) decided to take full advantage of our 
> > intranet, and wants to move from client-server applications to web-based 
> > applications. To that end, we're trying to determine the best platform 
> > for our applications. We're a Microsoft shop, with Microsoft SQL Server 
> > 2000 for all of our databases (that won't change any time soon, if 
> 
> what is special about the MSSQL2K servers? do you have a lot of stored
> procedures in it? stuff like that?
> 
> > ever). Due to past experience that I won't get into, we (the Development 
> > group) have all agreed that ASP.Net is out (at least for the short term).
> > 
> 
> if the MSSQL servers are so important/complex/big/etc then maybe ASP.not
> is the right way to go? given that moving 'everything' from
> client-server to web-baseed interfaces isn't really a short-term
> operation. (assuming some level of complexity in the existing software.)
> 
> > We had the opportunity to visit a local enterprise that has deployed 
> > ColdFusion, and they couldn't stop singing its praises. I'm partial to 
> > PHP, even after sampling Coldfusion, so what I would like is some 
> > "ammunition" that I can take into a meeting to "sell" management on PHP 
> > instead of ColdFusion. I've already been harping on the difference in 
> > cost, so I'm looking for other points to go with. Besides, we'll 
> > probably invest in Zend products if we choose PHP, and Macromedia has 
> 
> like marcromedia tools are required to run CF, they 'tie you in' to
> the technology. buying Zend products is optional, if the Zend IDE is judge to
> be a moneysaving tool for working with PHP then you buy it. But you
> don't have to. the essential tools are with out cost and open to inspection
> and modification. Purchasing Zend Accelerator/Encoder maybe a good move
> for you company but again its not a requirement.
> 
> from a strategic point of view it might also not be wise to make a
> substanstial investment in technology from a company thats just been
> bought out by the competion (adobe)?
> 
> > government rates available; I don't have any numbers (yet), but the cost 
> > difference may not be that great in the end.
> > 
> > Any input would be greatly appreciated. Opinions are welcome (especially 
> > from programmers with experience in both), but I have to "sell" it to 
> > management (I'm already on the PHP side), so links to data or articles 
> > comparing the two are best.
> > 
> > Thanks in advance,
> > Rick

--- End Message ---
--- Begin Message ---
In general, anyone could then say oh ".Net" framework, "Java" framework, 
"CPAN", or then any other full blown frameworks bloated!
I believe these kind of posts would not effect noone but it might create a 
bad perception for the net/platform voyagers!

Every framework, be it based on a language or an environment has a 
flexibility level that could satisfy some segment of programmers, and thus 
keeping some segments unhappy. It's a matter of prefrence and the kind of 
functionalities and repositories that a programmer or a team might need.
However, a general adjective can not be given just like that without any 
specification of the matter and why it is said it is in our case "Bloated".

In all the cases if someone thinks a framework is bloated. Should just keep 
it bloated for him/herself. Programmers, and specially PHP programmers who 
are the majority of web-programming in IT labor market. So being it bloated 
for someone or perceived to be bloated has no meaning for some other 
programmers, unless having the same needs and environment. 

It's simply a matter of prefrence. Period.

M.Saleh.E.G
+97150-4779817

--- End Message ---
--- Begin Message ---
Any help appreciated.

Thanks
Kundan.

Version PHP 4.3.11 and the corresponding snmp package.

--- End Message ---
--- Begin Message ---
I found this quite weired problem when I was trying to generate a
mysql query string, something like

.... WHERE TheDate<DATA_ADD(......)

The query string  returns something like

.... WHERE TheDate

Withought the left part.

You can actually try to use this to verify the problem:

echo '<br><br> e<D';

What you get? I got <D>
Quite confusing. Anyone think this is a bug or something I missed?

-- 
If you have a minute, please visit http://www.cchere.com

--- End Message ---
--- Begin Message ---
El Dom 26 Jun 2005 17:31, cchereTieShou escribió:
> I found this quite weired problem when I was trying to generate a
> mysql query string, something like
> 
> .... WHERE TheDate<DATA_ADD(......)
> 
> The query string  returns something like
> 
> .... WHERE TheDate
> 
> Withought the left part.
> 
> You can actually try to use this to verify the problem:
> 
> echo '<br><br> e<D';
> 
> What you get? I got <D>
> Quite confusing. Anyone think this is a bug or something I missed?


Uhhmm???

[EMAIL PROTECTED] ~]$ echo "<?php  echo '<br><br> e<D'; ?>" | php
Content-type: text/html; charset=iso-8859-1
X-Powered-By: PHP/4.3.11

<br><br> e<D

-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
---------------------------------------------------------
Martín Marqués          |   Programador, DBA
Centro de Telemática    |     Administrador
               Universidad Nacional
                    del Litoral
---------------------------------------------------------

--- End Message ---
--- Begin Message ---
cchereTieShou wrote:
> You can actually try to use this to verify the problem:
> 
> echo '<br><br> e<D';
> 
> What you get? I got <D>
> Quite confusing. Anyone think this is a bug or something I missed?

Are you viewing this via a web server? It's probably returning
content-type text/html, which means that you might need to
htmlspecialchars() that string.

--- End Message ---
--- Begin Message ---
> Are you viewing this via a web server? It's probably returning
> content-type text/html, which means that you might need to
> htmlspecialchars() that string.

That's what i was thinking.  It looks like how some browsers
would render that string.

Could you copy the relevant code  into a message?  Seeing
pseudo-script is different from seeing what you are actually
doing.

--- End Message ---
--- Begin Message ---
Kevin L'Huillier wrote:
> Could you copy the relevant code  into a message?  Seeing
> pseudo-script is different from seeing what you are actually
> doing.

Sure, either set the content-type to text/plain (to see the raw string
rather than have the browser interpret it as HTML), like this:

<?php
header('Content-Type: text/plain; charset=utf-8');
?>

or htmlspecialchars the string, like this:

<?php
print(htmlspecialchars($your_sql_string));
?>

Or just view source in your browser to see the raw string.

Jasper

--- End Message ---
--- Begin Message ---
On 26/06/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
> Kevin L'Huillier wrote:
> > Could you copy the relevant code  into a message?
> 
> Sure, either set the content-type to text/plain (to see the raw string
> rather than have the browser interpret it as HTML), like this:

Sorry, Jasper.  I meant the original poster of this thread.

--- End Message ---
--- Begin Message ---
Kevin L'Huillier wrote:
> On 26/06/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
> 
>>Kevin L'Huillier wrote:
>>
>>>Could you copy the relevant code  into a message?
>>
>>Sure, either set the content-type to text/plain (to see the raw string
>>rather than have the browser interpret it as HTML), like this:
> 
> 
> Sorry, Jasper.  I meant the original poster of this thread.

No problem, Kevin. In future, though, please remember not to "Reply All"
as getting the same email two or three times can be annoying!

Cheers

Jasper

--- End Message ---
--- Begin Message ---
the backslash has caught us all out when we first started, and beyond.
many 'noobs' have had the fortune of being explained, in depth,
how and why concerning the backslash by a singular Richard Lynch ...

but obviously nobody is immune (spot the mistake):
http://www.zend.com/codex.php?id=15&single=1

made me chuckle, thanks Richard - also for the whereis function and
the many tips! :-)

--- End Message ---
--- Begin Message ---
backslash was invented for windows ;)

Jochem Maas wrote:

the backslash has caught us all out when we first started, and beyond.
many 'noobs' have had the fortune of being explained, in depth,
how and why concerning the backslash by a singular Richard Lynch ...

but obviously nobody is immune (spot the mistake):
http://www.zend.com/codex.php?id=15&single=1

made me chuckle, thanks Richard - also for the whereis function and
the many tips! :-)


--- End Message ---
--- Begin Message ---
El Dom 26 Jun 2005 18:12, Jochem Maas escribió:
> the backslash has caught us all out when we first started, and beyond.
> many 'noobs' have had the fortune of being explained, in depth,
> how and why concerning the backslash by a singular Richard Lynch ...
> 
> but obviously nobody is immune (spot the mistake):
> http://www.zend.com/codex.php?id=15&single=1

The colors speak for themself. Just look at where everything turns red. :-D

This is one thing that makes me love editors that color the coding.

> made me chuckle, thanks Richard - also for the whereis function and
> the many tips! :-)

You bet!

-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
---------------------------------------------------------
Martín Marqués          |   Programador, DBA
Centro de Telemática    |     Administrador
               Universidad Nacional
                    del Litoral
---------------------------------------------------------

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
>> I have two databases, on for aeromodelistas (aeromodelling) and
>> another for Códigos Postais (Postal Codes). I whant to do the
> 
> what DB are you using? MySQL?
> you can't select across multiple DBs in any RDMS that I know of ...
> so it looks like either use 2 queries or merge the DBs?

I think he means tables. And yes you can, at least in MySQL, and
probably in others.

If you're using a version of MySQL prior to 4.1, though, you can't do
subqueries, which means that you'll need to reformulate your query with
joins.

Also DISTINCT isn't a function. The expression should be:

SELECT DISTINCT query_expr ...

not

SELECT distinct(query_expr) ...

Jasper

--- End Message ---
--- Begin Message ---
On 6/24/05, Joe Muddah <[EMAIL PROTECTED]> wrote:
> Thanks a bunch. I have alot of work now ahead of me to decide which
> framework to use. Any opinions on which one is the best?

I've used Mojavi heavily and I dabbled with Binarycloud a bit.

I like Ruby on Rails best:
http://www.rubyonrails.org/


-- 
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

--- End Message ---
--- Begin Message ---
On Sun, 2005-06-26 at 21:45, Greg Donald wrote:
> On 6/24/05, Joe Muddah <[EMAIL PROTECTED]> wrote:
> > Thanks a bunch. I have alot of work now ahead of me to decide which
> > framework to use. Any opinions on which one is the best?
> 
> I've used Mojavi heavily and I dabbled with Binarycloud a bit.
> 
> I like Ruby on Rails best:
> http://www.rubyonrails.org/

I think he's looking for a PHP approach.

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

--- End Message ---
--- Begin Message ---
Hello,

I am fairly new to PHP, and I am looking to create a search
functionality on a website using php. Can anyone point me to a good
tutorial that can walk me through this?

--- End Message ---
--- Begin Message --- I created my own counter. I have a varchar (10) field that resembles a date: 2005-06-26. Now I would like to parse out $mydata->StampDate to find how many hits per day I have had since "2003-08-23". Where do I start?

   while ($mydata = mysql_fetch_object($news))
   {
   }

John

--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law."

 ' ' '    Collège de Sherbrooke:
ô¿ô    http://www.collegesherbrooke.qc.ca/languesmodernes/
   -     819-569-2064

 °v°   Bibliography of Comparative Studies in Canadian, Québec and Foreign 
Literatures
/(_)\  Université de Sherbrooke
 ^ ^   http://compcanlit.ca/ T: 819.569.2064

--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:
> I created my own counter. I have a varchar (10) field that resembles a
> date: 2005-06-26. Now I would like to parse out $mydata->StampDate to
> find how many hits per day I have had since "2003-08-23". Where do I start?
> 
>    while ($mydata = mysql_fetch_object($news))
>    {
>    }

You can use strtotime() to convert your string date to a PHP date. and
then calculate it from that.

However, I'd strongly recommend using a real MySQL date field to store
the date. There's no reason not to, and then you can use MySQL native
functions to do a lot of the calculation.

Jasper

--- End Message ---
--- Begin Message --- I could just change the field type. But how do you calculate it? I don't see much to inspire a start. I'm not a full-time coder either. More of a tinkerer. I don't want someone to do it for me, but need to get my head around how to do it.
http://ca3.php.net/manual/en/function.strtotime.php
John

Jasper Bryant-Greene wrote:

John Taylor-Johnston wrote:
I created my own counter. I have a varchar (10) field that resembles a
date: 2005-06-26. Now I would like to parse out $mydata->StampDate to
find how many hits per day I have had since "2003-08-23". Where do I start?

  while ($mydata = mysql_fetch_object($news))
  {
  }

You can use strtotime() to convert your string date to a PHP date. and
then calculate it from that.

However, I'd strongly recommend using a real MySQL date field to store
the date. There's no reason not to, and then you can use MySQL native
functions to do a lot of the calculation.

Jasper

--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:
> I could just change the field type. But how do you calculate it? I don't
> see much to inspire a start. I'm not a full-time coder either. More of a
> tinkerer. I don't want someone to do it for me, but need to get my head
> around how to do it.
> http://ca3.php.net/manual/en/function.strtotime.php

If you stick with a string data type, then I'd use the following to
convert it to a UNIX timestamp (seconds since 1970-01-01) and find the
number of days since 23 August 2003:

$unix_timestamp  = strtotime($mydata->StampDate);
$timestamp_2003  = strtotime('2003-08-23');

$days_since_2003 = ($unix_timestamp - $timestamp_2003) / 60 / 60 / 24;

$days_since_2003 now contains the number of days since 2003 for that
date. You'd have to aggregate all your records to get the average hits
per day.

As I said, though, you should be using a MySQL date field. Have a look
at the MySQL manual for the corresponding functions to the above --
there's probably a quicker way with MySQL too.

Jasper

--- End Message ---

Reply via email to