Re: [PHP] Re: require() causing strange characters ?

2009-02-10 Thread Nisse Engström
On Mon, 9 Feb 2009 15:46:35 +0100, cr.vege...@gmail.com wrote:

 I've tested it again, from scratch with Notepad editor:
 
 echoUTF8.php?php require(echoUTF8sub.php); ?
 echoUTF8sub.php   ?php echo test; ?
 and keep getting strange characters.
 
 Would you be so kind to run these 2 scripts on your pc ?

Works fine for me, probably because my copy of Notepad
is so old it has never heard of Unicode...

Here's another test:

echoUTF8.php:
-
?php require 'echoUTF8sub.php';

echoUTF8sub.php:

?php echo \xef\xbb\xbf, test\n;  // Manual BOM

When I run this from a browser, I get different output
depend on the server's and browser's default charset,
and PHP's default_charset setting.

I get consistent results when I add

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

to echoUTF8.php.


(When the scripts are run from command-line, the output
 would also depend on the shells ability to handle utf-8.)


/Nisse

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



[PHP] Re: PHP OOP

2009-02-10 Thread Ondrej Kulaty
I don't think that PHP is good language for teaching OOP as many folks above 
said. I have never programmed in OOP style but i plan to learn it. I started 
in PHP but i was little confused and i am used to program in procedural way 
in PHP, so i've decided to learn some pure OOP language. I am reading a book 
OOP Demystified, there are examples in both C++ and Java. And imo Java code 
is much more readable and understandable. So i think that Java is the best 
for learning OOP. I am also considering learning C#, if you dont mind that 
it's closely related to windows, it might be also a good choice.
-- 

tedd t...@sperling.com píse v diskusním príspevku 
news:p0624080dc5b5fff1c...@[192.168.1.101]...
 Hi gang:

 At the college where I teach, they are considering teaching OOP, but they 
 don't want to settle on a specific language.

 My thoughts are it's difficult to teach OOP without a language -- 
 while the general concepts of OOP are interesting, people need to see how 
 concepts are applied to understand how they work -- thus I think a 
 specific language is required

 I lean toward C++ because I wrote in it for a few years AND C++ appears to 
 be the most common, widespread, and popular OOP language.

 However, while I don't know PHP OOP, I am open to considering it because 
 of the proliferation of web based applications. My personal opinion is 
 that's where all programming is headed anyway, but that's just my opinion.

 With that said, what's the differences and advantages/disadvantages 
 between C++ and PHP OOP?

 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] PHP OOP

2009-02-10 Thread Marcus Gnaß

Paul M Foster wrote:

On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
  
As a side note, I think students should learn a language like C before

learning something like Perl, Python or PHP. Having to deal with
defining/declaring variables and their storage methods before use I
think makes for more conscientious programmers. And pointers are an
education all on their own. ;-}
  
For teaching programming or OOP I would choose a language which 
concentrates on the topic. The hard stuff, which you have to deal with 
in C for example, can be learned later. I'm glad that I started 
programming in Pascal, not in C. If today I had to learn programming as 
such I would definitively opt for Python! My choice for learning OOP 
would be Python or even better Java cause you don't have the choice to 
do it in a procedural way.


Marcus

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



Re: [PHP] paging

2009-02-10 Thread tedd

At 3:26 AM + 2/10/09, Jim Douglas wrote:

Does anyone have a link to any examples of paging?



Jim:

Sure.

http://webbytedd.com/bbb/paging/  -- the code is there

different examples here:

http://webbytedd.com/ccc/pagination

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



RES: [PHP] paging

2009-02-10 Thread Jônatas Zechim
MySql or MsSql or other dB?

-Mensagem original-
De: tedd [mailto:tedd.sperl...@gmail.com] 
Enviada em: terça-feira, 10 de fevereiro de 2009 11:26
Para: Jim Douglas; php-general@lists.php.net
Assunto: Re: [PHP] paging

At 3:26 AM + 2/10/09, Jim Douglas wrote:
Does anyone have a link to any examples of paging?


Jim:

Sure.

http://webbytedd.com/bbb/paging/  -- the code is there

different examples here:

http://webbytedd.com/ccc/pagination

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



Re: [PHP] PHP OOP

2009-02-10 Thread Carlos Medina

Marcus Gnaß schrieb:

Paul M Foster wrote:

On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
  As a side note, I think students should learn a language like C before
learning something like Perl, Python or PHP. Having to deal with
defining/declaring variables and their storage methods before use I
think makes for more conscientious programmers. And pointers are an
education all on their own. ;-}
  
For teaching programming or OOP I would choose a language which 
concentrates on the topic. The hard stuff, which you have to deal with 
in C for example, can be learned later. I'm glad that I started 
programming in Pascal, not in C. If today I had to learn programming as 
such I would definitively opt for Python! My choice for learning OOP 
would be Python or even better Java cause you don't have the choice to 
do it in a procedural way.


Marcus

Hi @ all,
but this is a php list...

Regards

Carlos

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



Re: [PHP] paging

2009-02-10 Thread Richard Heyes
 ...

Hi,

Too lazy to actually read the email (tsk), but there's rather a nice
paging library in PEAR that may help. Imaginitively called Pager.

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 31st)

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



Re: [PHP] PHP OOP

2009-02-10 Thread Byron
Where I study, Intro to OOP is taught in C# using Visual Studio 2003 and
further OOP concepts are taught in Java, with the academic computer science
of OOP alongside.

On Wed, Feb 11, 2009 at 2:40 AM, Carlos Medina i...@simply-networks.dewrote:

 Marcus Gnaß schrieb:

 Paul M Foster wrote:

 On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
  As a side note, I think students should learn a language like C before
 learning something like Perl, Python or PHP. Having to deal with
 defining/declaring variables and their storage methods before use I
 think makes for more conscientious programmers. And pointers are an
 education all on their own. ;-}


 For teaching programming or OOP I would choose a language which
 concentrates on the topic. The hard stuff, which you have to deal with in C
 for example, can be learned later. I'm glad that I started programming in
 Pascal, not in C. If today I had to learn programming as such I would
 definitively opt for Python! My choice for learning OOP would be Python or
 even better Java cause you don't have the choice to do it in a procedural
 way.

 Marcus

 Hi @ all,
 but this is a php list...

 Regards

 Carlos


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




-- 
I'm going out to find myself, if you see me here, keep me here untill I can
catch up

If I haven't said so already,

Thanks
Byron


[PHP] Looking for some PHP OO programming guides

2009-02-10 Thread Michael Kubler

Hi,
I'm just getting into programming in an Object Oriented fashion, and am 
looking for some guides, tutorials, hints, tips, etc...


I only just found out that you remove the $ from variables when calling 
them from $this-


e.g :
?php
class People
{
private $person = not set;
   function __construct()
   {
*$person* = A person; //This doesn't work (well it creates a 
variable $person that only has the scope of the current function from 
what I can gather)..

$this-*person* = A person; //This works properly
}
   function display_list()
   {
   echo $person; //This doesn't work
 echo $this-person; //This works.
   }
}

$person= new People;
$person-display_list();
?


Instead of painstakingly working out most of the other mistakes I'm 
likely to make, I'd love to read about other peoples issues they had 
with learning OO so I can skip most of the hard stuff, and only make 
small mistakes (hopefully).

--

Michael Kubler
*G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz



Re: [PHP] PHP OOP

2009-02-10 Thread Andrew Ballard
On Tue, Feb 10, 2009 at 8:40 AM, Carlos Medina i...@simply-networks.de wrote:
 Marcus Gnaß schrieb:

 Paul M Foster wrote:

 On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
  As a side note, I think students should learn a language like C before
 learning something like Perl, Python or PHP. Having to deal with
 defining/declaring variables and their storage methods before use I
 think makes for more conscientious programmers. And pointers are an
 education all on their own. ;-}


 For teaching programming or OOP I would choose a language which
 concentrates on the topic. The hard stuff, which you have to deal with in C
 for example, can be learned later. I'm glad that I started programming in
 Pascal, not in C. If today I had to learn programming as such I would
 definitively opt for Python! My choice for learning OOP would be Python or
 even better Java cause you don't have the choice to do it in a procedural
 way.

 Marcus

 Hi @ all,
 but this is a php list...

 Regards

 Carlos


Yes, it is, but the original question was about OOP and not
specifically about PHP. It seems fair enough to me for someone to ask
the question on this list since PHP was one of the languages being
considered, even if consensus among the list seems to be that PHP
would not be the best choice for teaching a course on OOP.

Andrew

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



Re: [PHP] Looking for some PHP OO programming guides

2009-02-10 Thread Stuart
2009/2/10 Michael Kubler mdk...@gmail.com:
 Hi,
 I'm just getting into programming in an Object Oriented fashion, and am
 looking for some guides, tutorials, hints, tips, etc...

 I only just found out that you remove the $ from variables when calling them
 from $this-

 e.g :
 ?php
 class People
 {
 private $person = not set;
   function __construct()
   {
*$person* = A person; //This doesn't work (well it creates a variable
 $person that only has the scope of the current function from what I can
 gather)..
$this-*person* = A person; //This works properly
}
   function display_list()
   {
   echo $person; //This doesn't work
 echo $this-person; //This works.
   }
 }

 $person= new People;
 $person-display_list();
 ?


 Instead of painstakingly working out most of the other mistakes I'm likely
 to make, I'd love to read about other peoples issues they had with learning
 OO so I can skip most of the hard stuff, and only make small mistakes
 (hopefully).

Ok, because it's you I'm going to offer you this ebook at the very
very very low limited time price of $49 and I'll throw in a free
watermelon.

Ahh, hell, I can't be arsed. It's in the frickin' manual: http://php.net/oop

-Stuart

-- 
http://stut.net/

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



Re: [PHP] Using DLL with PHP

2009-02-10 Thread Dan Shirah
 Alrighty, so I went a different route...

I created my own ActiveX DLL...one that I know I can register.

Starting out really simple:

//My VB code
Public Function hello() As String

hello = Hello World!
End Function

//My PHP code
?php
function Hello() {
$new_com = new COM(DMStoTIFF.conv);
$output=$new_com-hello();
echo $output;}
Hello();
?

So, after I register the DLL on the server my PHP page is correctly
displaying the Hello World! dialog.

What I'm having problems with now is trying to pass a variable to the DLL.

Shouldn't I be able to do this just like any other PHP class/function?


RE: RES: [PHP] paging

2009-02-10 Thread Jim Douglas

MySQL

 From: zechim@gmail.com
 To: tedd.sperl...@gmail.com; jd...@hotmail.com; php-general@lists.php.net
 Subject: RES: [PHP] paging
 Date: Tue, 10 Feb 2009 11:33:42 -0200
 
 MySql or MsSql or other dB?
 
 -Mensagem original-
 De: tedd [mailto:tedd.sperl...@gmail.com] 
 Enviada em: terça-feira, 10 de fevereiro de 2009 11:26
 Para: Jim Douglas; php-general@lists.php.net
 Assunto: Re: [PHP] paging
 
 At 3:26 AM + 2/10/09, Jim Douglas wrote:
 Does anyone have a link to any examples of paging?
 
 
 Jim:
 
 Sure.
 
 http://webbytedd.com/bbb/paging/  -- the code is there
 
 different examples here:
 
 http://webbytedd.com/ccc/pagination
 
 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
 

_
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_022009

Re: [PHP] Using DLL with PHP

2009-02-10 Thread Andrew Ballard
On Tue, Feb 10, 2009 at 11:59 AM, Dan Shirah mrsqua...@gmail.com wrote:
 Alrighty, so I went a different route...

 I created my own ActiveX DLL...one that I know I can register.

 Starting out really simple:

 //My VB code
 Public Function hello() As String

 hello = Hello World!
 End Function

 //My PHP code
 ?php
 function Hello() {
 $new_com = new COM(DMStoTIFF.conv);
 $output=$new_com-hello();
 echo $output;}
 Hello();
 ?

 So, after I register the DLL on the server my PHP page is correctly
 displaying the Hello World! dialog.

 What I'm having problems with now is trying to pass a variable to the DLL.

 Shouldn't I be able to do this just like any other PHP class/function?

Generally I think you can. You may run into issues where the function
parameters and return values must be defined as variants in your DLL,
or you may need to cast your PHP variables into instances of the
VARIANT class.

In ASP I mostly used the Scripting.Dictionary (like a hash table, I
guess, since arrays in VBScript are all integer-indexed),
Scripting.FileSystemObject, the ADODB library for database access, and
sometimes a utility to manipulate images, process file uploads, or
file compression. PHP already has extensions for all of these, so I
haven't had to delve into the complexity of using COM in PHP.

Just for kicks, I just tried this in Zend Studio which is running PHP
5.2.0 under WinXP, and it worked as expected:

?php

$some_file = '';  // PATH TO SOME FILE

$x = new COM('Scripting.FileSystemObject');

if ($x-FileExists($some_file)) {
echo 'The file exists!';
} else {
echo 'The file does not exist.';
}

?

Andrew

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



RE: [PHP] paging

2009-02-10 Thread Jim Douglas

I saw your site originally.  I have paging working and I also have this example 
working,
http://www.w3schools.com/php/php_ajax_database.asp
 My problem is not getting paging to work, it's getting paging to work 
outputting the results of clicking on the page number to the content pane.  I 
have a CSS that has left, right, header, footer and a content pane.  After I 
click on the drop down it outputs to the content pane just fine.

Thanks,
Jim





 Date: Tue, 10 Feb 2009 08:26:23 -0500
 To: jd...@hotmail.com; php-general@lists.php.net
 From: tedd.sperl...@gmail.com
 Subject: Re: [PHP] paging
 
 At 3:26 AM + 2/10/09, Jim Douglas wrote:
 Does anyone have a link to any examples of paging?
 
 
 Jim:
 
 Sure.
 
 http://webbytedd.com/bbb/paging/  -- the code is there
 
 different examples here:
 
 http://webbytedd.com/ccc/pagination
 
 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
 

_
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Faster_022009

[PHP] Re: Looking for some PHP OO programming guides

2009-02-10 Thread Tony Marston
Take a look at http://www.tonymarston.net/php-mysql/databaseobjects.html

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

Michael Kubler mdk...@gmail.com wrote in message 
news:49918ebf.4070...@gmail.com...
 Hi,
 I'm just getting into programming in an Object Oriented fashion, and am
 looking for some guides, tutorials, hints, tips, etc...

 I only just found out that you remove the $ from variables when calling
 them from $this-

 e.g :
 ?php
 class People
 {
 private $person = not set;
function __construct()
{
 *$person* = A person; //This doesn't work (well it creates a
 variable $person that only has the scope of the current function from
 what I can gather)..
 $this-*person* = A person; //This works properly
 }
function display_list()
{
echo $person; //This doesn't work
  echo $this-person; //This works.
}
 }

 $person= new People;
 $person-display_list();
 ?


 Instead of painstakingly working out most of the other mistakes I'm
 likely to make, I'd love to read about other peoples issues they had
 with learning OO so I can skip most of the hard stuff, and only make
 small mistakes (hopefully).
 -- 

 Michael Kubler
 *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz

 



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



[PHP] Re: paging

2009-02-10 Thread Tony Marston
Take a look at http://www.tonymarston.net/php-mysql/pagination.html

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

Jim Douglas jd...@hotmail.com wrote in message 
news:col119-w57b0a24af94fce04673622bb...@phx.gbl...

Does anyone have a link to any examples of paging?

I have this example up and running,



http://www.w3schools.com/php/php_ajax_database.asp



I
have paging working as below, my problem is when I add a CSS style
sheet I now have 4 panes.  How can I direct the paging results to the
content pane?



?php

$q=$_GET[q];

$start=$_GET[start];



$con = mysql_connect('localhost', 'root', 'mypassword');

if (!$con)

 {die('Could not connect: ' . mysql_error());}



mysql_select_db(bar, $con);

$page_name=getbars.php;



if(!isset($start)) {$start = 0;}



$sql2=select * from bars WHERE geog_id = '.$q.';

$result2=mysql_query($sql2);

echo mysql_error();

$nume=mysql_num_rows($result2);



$eu = ($start - 0);

$limit = 10;

$this1 = $eu + $limit;

$back = $eu - $limit;

$next = $eu + $limit;

$sql=select * from bars WHERE geog_id = '.$q.' limit $eu, $limit;



$result = mysql_query($sql);



echo table border='0';

while($row = mysql_fetch_array($result))

  {

  if($bgcolor=='#f1f1f1'){$bgcolor='#ff';}

  else{$bgcolor='#f1f1f1';}

echo tr ;


//echo td align=left bgcolor=$bgcolor
id='title'nbsp;font face='Verdana' size='2'A
HREF= . $row['bar_website'] .. $row['bar_name'] .
/A/div/font/td;

echo div id='lbBarList' /div;


echo td align=left bgcolor=$bgcolor
id='title'nbsp;font face='Verdana' size='2'A
HREF= . $row['bar_website'] .. $row['bar_name'] .
/A/div/font/td/div;

  echo /tr;

}

echo /table;





if($nume  $limit ){ // Let us display bottom links if sufficient records 
are there for paging

  /// Start the bottom links with Prev and next link with page 
numbers /

  echo table align = 'center' width='50%'trtd  align='left' 
width='30%';

   if our variable $back is equal to 0 or more then only we will display 
the link to move back 

   if($back =0) {

 print a href='$page_name?start=$back'font face='Verdana' 
size='2'PREV/font/a;

   }

}

echo /tdtd align=center width='30%';



$i=0;

$l=1;

for($i=0;$i  $nume;$i=$i+$limit){

if($i  $eu){

//echo  a href='$page_name?start=$i'font face='Verdana' 
size='2'$l/font/a ;

echo  a href='$page_name?start=$i'font face='Verdana' 
size='2'$l/font/a ;

}

else { echo font face='Verdana' size='4' color=red$l/font;}

$l=$l+1;

}



mysql_close($con);
_
Windows Live™: Keep your life in sync.
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_022009 



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



Re: [PHP] Using DLL with PHP

2009-02-10 Thread Shawn McKenzie
Dan Shirah wrote:
  Alrighty, so I went a different route...
 
 I created my own ActiveX DLL...one that I know I can register.
 
 Starting out really simple:
 
 //My VB code
 Public Function hello() As String
 
 hello = Hello World!
 End Function
 
 //My PHP code
 ?php
 function Hello() {
 $new_com = new COM(DMStoTIFF.conv);
 $output=$new_com-hello();
 echo $output;}
 Hello();
 ?
 
 So, after I register the DLL on the server my PHP page is correctly
 displaying the Hello World! dialog.
 
 What I'm having problems with now is trying to pass a variable to the DLL.
 
 Shouldn't I be able to do this just like any other PHP class/function?
 
It doesn't appear that your function accepts a parameter.  What does
this do:

//VB
Public Function hello(ByVal name As String) As String
hello = Hello   name  !
End Function

//PHP
echo $new_com-hello(Dan);

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Using DLL with PHP

2009-02-10 Thread Dan Shirah

  It doesn't appear that your function accepts a parameter.  What does
 this do:

 //VB
 Public Function hello(ByVal name As String) As String
hello = Hello   name  !
 End Function

 //PHP
 echo $new_com-hello(Dan);

 --
 Thanks!
 -Shawn
 http://www.spidean.com


Shawn I tried what you suggested but it returns the following:

*Fatal error*: Cannot pass parameter 1 by reference


Re: [PHP] Re: paging

2009-02-10 Thread Richard Heyes
 ...

Are you the same Tony Marston who was on the Demon Internet webmaster
type mailing list? (I don't remember the actual name).

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 31st)

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



Re: [PHP] Using DLL with PHP

2009-02-10 Thread Shawn McKenzie
Dan Shirah wrote:
  It doesn't appear that your function accepts a parameter.  What does
 this do:

 //VB
 Public Function hello(ByVal name As String) As String
hello = Hello   name  !
 End Function

 //PHP
 echo $new_com-hello(Dan);

 --
 Thanks!
 -Shawn
 http://www.spidean.com

 
 Shawn I tried what you suggested but it returns the following:
 
 *Fatal error*: Cannot pass parameter 1 by reference
 
Just guessing as I haven't used the PHP COM stuff, but what do you get
if you change ByVal to ByRef?

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Using DLL with PHP

2009-02-10 Thread Dan Shirah

  Just guessing as I haven't used the PHP COM stuff, but what do you get
 if you change ByVal to ByRef?

 --
  Thanks!
 -Shawn
 http://www.spidean.com


Ooops!  My fault!  I created a new dll so I could keep the currently working
one and forgot to register it..

Registered and it allowed the passing of the variable and the display came
out correctly!

Baby Steps...

Now I just need to incorporate a Lib .dll call into my working activex
dll and I might be on my way.


[PHP] Creating A Unique List With Table Query

2009-02-10 Thread revDAVE
Newbie question

Hi Folks,

I would like to be able to query a table, and return only the unique values
from a particular field. For example: to get all contents from the category
field from the contacts table:

Query = 

SELECT Category FROM contacts

But this will produce many duplicates.

Question : How do I filter the query to only produce unique values?
 
I was looking at: array_unique but I am not sure how to implement this in a
MYSql table query

Any help would be appreciated - thanks Dave



--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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



Re: [PHP] Creating A Unique List With Table Query

2009-02-10 Thread Andrew Ballard
On Tue, Feb 10, 2009 at 2:41 PM, revDAVE c...@hosting4days.com wrote:
 Newbie question

 Hi Folks,

 I would like to be able to query a table, and return only the unique values
 from a particular field. For example: to get all contents from the category
 field from the contacts table:

 Query = 

 SELECT Category FROM contacts

 But this will produce many duplicates.

 Question : How do I filter the query to only produce unique values?

 I was looking at: array_unique but I am not sure how to implement this in a
 MYSql table query

 Any help would be appreciated - thanks Dave



 --
 Thanks - RevDave
 Cool @ hosting4days . com
 [db-lists 09]



SELECT DISTINCT Category FROM contacts

Andrew

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



Re: [PHP] Creating A Unique List With Table Query

2009-02-10 Thread Per Jessen
revDAVE wrote:

 Newbie question
 
 Hi Folks,
 
 I would like to be able to query a table, and return only the unique
 values from a particular field. For example: to get all contents from
 the category field from the contacts table:
 
 Query = 
 
 SELECT Category FROM contacts
 
 But this will produce many duplicates.
 
 Question : How do I filter the query to only produce unique values?

SELECT DISTINCT Category FROM contacts



-- 
Per Jessen, Zürich (1.6°C)


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



Re: [PHP] Re: require() causing strange characters ?

2009-02-10 Thread Ashley Sheridan
On Tue, 2009-02-10 at 12:36 +0100, Nisse Engström wrote:
 On Mon, 9 Feb 2009 15:46:35 +0100, cr.vege...@gmail.com wrote:
 
  I've tested it again, from scratch with Notepad editor:
  
  echoUTF8.php?php require(echoUTF8sub.php); ?
  echoUTF8sub.php   ?php echo test; ?
  and keep getting strange characters.
  
  Would you be so kind to run these 2 scripts on your pc ?
 
 Works fine for me, probably because my copy of Notepad
 is so old it has never heard of Unicode...
 
 Here's another test:
 
 echoUTF8.php:
 -
 ?php require 'echoUTF8sub.php';
 
 echoUTF8sub.php:
 
 ?php echo \xef\xbb\xbf, test\n;  // Manual BOM
 
 When I run this from a browser, I get different output
 depend on the server's and browser's default charset,
 and PHP's default_charset setting.
 
 I get consistent results when I add
 
   header ('Content-Type: text/plain; charset=utf-8');
 
 to echoUTF8.php.
 
 
 (When the scripts are run from command-line, the output
  would also depend on the shells ability to handle utf-8.)
 
 
 /Nisse
 
I know this might be going slightly off topic, but just wanted to
suggest Notepad++ as an alternative text editor. I use it when I work on
Windows systems, and it's been a great boon, adding some of those nice
features as well as supporting utf-8, etc.


Ash
www.ashleysheridan.co.uk


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



[PHP] Re: [Bulk] [PHP] Creating A Unique List With Table Query

2009-02-10 Thread Stephen

revDAVE wrote:

I would like to be able to query a table, and return only the unique values
from a particular field. For example: to get all contents from the category
field from the contacts table:

Query = 

SELECT Category FROM contacts

But this will produce many duplicates.

Question : How do I filter the query to only produce unique values?
 
  

Check out the DISTINCT keyword in the SELECT documentation.

Also, do you have a Category table?

Stephen

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



Re: [PHP] Re: Looking for some PHP OO programming guides

2009-02-10 Thread Kyle Terry
On Tue, Feb 10, 2009 at 9:46 AM, Tony Marston
t...@marston-home.demon.co.uk wrote:
 Take a look at http://www.tonymarston.net/php-mysql/databaseobjects.html

 --
 Tony Marston
 http://www.tonymarston.net
 http://www.radicore.org

 Michael Kubler mdk...@gmail.com wrote in message
 news:49918ebf.4070...@gmail.com...
 Hi,
 I'm just getting into programming in an Object Oriented fashion, and am
 looking for some guides, tutorials, hints, tips, etc...

 I only just found out that you remove the $ from variables when calling
 them from $this-

 e.g :
 ?php
 class People
 {
 private $person = not set;
function __construct()
{
 *$person* = A person; //This doesn't work (well it creates a
 variable $person that only has the scope of the current function from
 what I can gather)..
 $this-*person* = A person; //This works properly
 }
function display_list()
{
echo $person; //This doesn't work
  echo $this-person; //This works.
}
 }

 $person= new People;
 $person-display_list();
 ?


 Instead of painstakingly working out most of the other mistakes I'm
 likely to make, I'd love to read about other peoples issues they had
 with learning OO so I can skip most of the hard stuff, and only make
 small mistakes (hopefully).
 --

 Michael Kubler
 *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz





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



Don't next 8 foreach loops in OOP.

-- 
Kyle Terry | www.kyleterry.com
Help kick start VOOM (Very Open Object Model) for a library of PHP classes.
http://www.voom.me | IRC EFNet #voom

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



Re: [PHP] Re: Looking for some PHP OO programming guides

2009-02-10 Thread Kyle Terry
On Tue, Feb 10, 2009 at 12:07 PM, Kyle Terry k...@kyleterry.com wrote:
 On Tue, Feb 10, 2009 at 9:46 AM, Tony Marston
 t...@marston-home.demon.co.uk wrote:
 Take a look at http://www.tonymarston.net/php-mysql/databaseobjects.html

 --
 Tony Marston
 http://www.tonymarston.net
 http://www.radicore.org

 Michael Kubler mdk...@gmail.com wrote in message
 news:49918ebf.4070...@gmail.com...
 Hi,
 I'm just getting into programming in an Object Oriented fashion, and am
 looking for some guides, tutorials, hints, tips, etc...

 I only just found out that you remove the $ from variables when calling
 them from $this-

 e.g :
 ?php
 class People
 {
 private $person = not set;
function __construct()
{
 *$person* = A person; //This doesn't work (well it creates a
 variable $person that only has the scope of the current function from
 what I can gather)..
 $this-*person* = A person; //This works properly
 }
function display_list()
{
echo $person; //This doesn't work
  echo $this-person; //This works.
}
 }

 $person= new People;
 $person-display_list();
 ?


 Instead of painstakingly working out most of the other mistakes I'm
 likely to make, I'd love to read about other peoples issues they had
 with learning OO so I can skip most of the hard stuff, and only make
 small mistakes (hopefully).
 --

 Michael Kubler
 *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz





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



 Don't next 8 foreach loops in OOP.

 --
 Kyle Terry | www.kyleterry.com
 Help kick start VOOM (Very Open Object Model) for a library of PHP classes.
 http://www.voom.me | IRC EFNet #voom


Don't neSt 8 foreach loops in OOP.

-- 
Kyle Terry | www.kyleterry.com
Help kick start VOOM (Very Open Object Model) for a library of PHP classes.
http://www.voom.me | IRC EFNet #voom

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



Re: [PHP] Creating A Unique List With Table Query

2009-02-10 Thread revDAVE
On 2/10/2009 11:45 AM, Andrew Ballard aball...@gmail.com wrote:

 SELECT DISTINCT Category FROM contacts

Thanks folks - that was perfect!


On 2/10/2009 11:46 AM, Stephen stephe...@rogers.com wrote:

 Also, do you have a Category table?
 
No Stephen I don't.



--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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



Re: [PHP] Re: Looking for some PHP OO programming guides

2009-02-10 Thread Andrew Ballard
On Tue, Feb 10, 2009 at 3:09 PM, Kyle Terry k...@kyleterry.com wrote:
 On Tue, Feb 10, 2009 at 12:07 PM, Kyle Terry k...@kyleterry.com wrote:
 On Tue, Feb 10, 2009 at 9:46 AM, Tony Marston
 t...@marston-home.demon.co.uk wrote:
 Take a look at http://www.tonymarston.net/php-mysql/databaseobjects.html

 --
 Tony Marston
 http://www.tonymarston.net
 http://www.radicore.org

 Michael Kubler mdk...@gmail.com wrote in message
 news:49918ebf.4070...@gmail.com...
 Hi,
 I'm just getting into programming in an Object Oriented fashion, and am
 looking for some guides, tutorials, hints, tips, etc...

 I only just found out that you remove the $ from variables when calling
 them from $this-

 e.g :
 ?php
 class People
 {
 private $person = not set;
function __construct()
{
 *$person* = A person; //This doesn't work (well it creates a
 variable $person that only has the scope of the current function from
 what I can gather)..
 $this-*person* = A person; //This works properly
 }
function display_list()
{
echo $person; //This doesn't work
  echo $this-person; //This works.
}
 }

 $person= new People;
 $person-display_list();
 ?


 Instead of painstakingly working out most of the other mistakes I'm
 likely to make, I'd love to read about other peoples issues they had
 with learning OO so I can skip most of the hard stuff, and only make
 small mistakes (hopefully).
 --

 Michael Kubler
 *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz





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



 Don't next 8 foreach loops in OOP.

 --
 Kyle Terry | www.kyleterry.com
 Help kick start VOOM (Very Open Object Model) for a library of PHP classes.
 http://www.voom.me | IRC EFNet #voom


 Don't neSt 8 foreach loops in OOP.

Yikes! I'd try my best to avoid nesting 8 foreach loops in procedural code, too.

 --
 Kyle Terry | www.kyleterry.com
 Help kick start VOOM (Very Open Object Model) for a library of PHP classes.
 http://www.voom.me | IRC EFNet #voom


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



Re: [PHP] PHP OOP

2009-02-10 Thread tedd

At 9:36 AM -0500 2/10/09, Andrew Ballard wrote:
On Tue, Feb 10, 2009 at 8:40 AM, Carlos Medina 
i...@simply-networks.de wrote:

  Marcus Gnaß schrieb:

  Hi @ all,

 but this is a php list...

 Regards

 Carlos



Yes, it is, but the original question was about OOP and not
specifically about PHP. It seems fair enough to me for someone to ask
the question on this list since PHP was one of the languages being
considered, even if consensus among the list seems to be that PHP
would not be the best choice for teaching a course on OOP.

Andrew



Andrew:

Absolutely, you're not out of line at all.

TI have found in my life that there will always 
be those who have a better idea, if you know what 
I mean.


The point of the post (me being the OP) was to 
sample other people's opinion as to what would be 
best language to use to teach OOP, and that 
included considering php, thus the relevancy.


The answer turns out to be Java (1) or C++ (2) 
depending upon the environment and availability 
of resources.


Why people have to get on and comment that this 
is a php list is beyond me, duh.


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] APC problem with PHP

2009-02-10 Thread Jamie Krasnoo
Hey all,

I'm new to the list. I came here because I couldn't find the answer to
my question and I'm hoping I can find it here. I compiled the APC
plugin as a shared library and activated it through the php.ini. I ran
'make test' and it seemed to pass all but one (it skipped a test). I
thought all was well. Unfortunately it wasn't. In the middle of the
night I woke up to SMS messages from the monitoring that the server
was going down hard. I got the server back up and found that PHP was
segfaulting and puking core files everywhere and it filled up the
drive.

I removed all the core files and restarted the server and it happened
again. So I removed APC, restarted the server and the core files
stopped. So just to make sure I put APC back on and saw that PHP
started dumping again.

I'm not advanced enough to try and debug the core files but I do know
enough to try and see what is going on. I used gdb to peer in to a
core file and saw that libthread_db.1.so or something like that was
the culprit. Does anyone know what would cause PHP to start
segfaulting after APC was installed?

Thanks,

Jamie

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



[PHP] Module Structure ideas

2009-02-10 Thread Sancar Saran
Hello List,

Last year I began to sepearte my module files to many files for their 
purposes.

Last time use use lots of dirs for their types

someting like

controllers
  a.cont.php
  b.cont.php
definition
  a.def.php
  b.def.php
models
  a.model.php
  b.model.php
views
  a.view.php
  b.view.php

Then I realize this model creates confusion when you start to debug a module.

My next step was putting module files in one dir, 
also I want to load them into text editor with spesific order 
(same to including order).

and I came up some ting like this

a.test.def.php
c.test.mdl.php
e.test.cnt.php
g.test.rtr.php
i.test.view.php
k.test.dr.js
m.test.m.js
o.test.css

test_app.a.def.php
test_app.c.mdl.php
test_app.e.cnt.php
test_app.g.rtr.php
test_app.i.view.php
test_app.k.dr.js
test_app.m.js
test_app.o.css

test.adef.php
test.cmdl.php
test.ecnt.php
test.grtr.php
test.iview.php
test.kdr.js
test.m.js
test.o.css

My point of view the 3. option is good for me.  

So I want to ask  this 

(beacause I'm using very closed working model. Just KDE and KATE)

is kind of file structure may lead any kind of problems in future or 
diffrerent situation ?

also is there any suggestion to using different methot to archive similar 
goals.

Regards

Sancar

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



Re: [PHP] APC problem with PHP

2009-02-10 Thread Nathan Nobbe
On Tue, Feb 10, 2009 at 4:10 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Hey all,

 I'm new to the list. I came here because I couldn't find the answer to
 my question and I'm hoping I can find it here. I compiled the APC
 plugin as a shared library and activated it through the php.ini. I ran
 'make test' and it seemed to pass all but one (it skipped a test). I
 thought all was well. Unfortunately it wasn't. In the middle of the
 night I woke up to SMS messages from the monitoring that the server
 was going down hard. I got the server back up and found that PHP was
 segfaulting and puking core files everywhere and it filled up the
 drive.

 I removed all the core files and restarted the server and it happened
 again. So I removed APC, restarted the server and the core files
 stopped. So just to make sure I put APC back on and saw that PHP
 started dumping again.

 I'm not advanced enough to try and debug the core files but I do know
 enough to try and see what is going on. I used gdb to peer in to a
 core file and saw that libthread_db.1.so or something like that was
 the culprit. Does anyone know what would cause PHP to start
 segfaulting after APC was installed?


are you using apache and if so, do you have threading enabled?

-nathan


Re: [PHP] APC problem with PHP

2009-02-10 Thread Jamie Krasnoo
Yes, I'm using Apache 2.2.11 and I do believe that threading could be
enabled. Apache was compiled through cPanel with Easy::Apache. I
didn't see any options to disable threading unless I missed it.

Jamie

On Tue, Feb 10, 2009 at 3:51 PM, Nathan Nobbe quickshif...@gmail.com wrote:
 On Tue, Feb 10, 2009 at 4:10 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Hey all,

 I'm new to the list. I came here because I couldn't find the answer to
 my question and I'm hoping I can find it here. I compiled the APC
 plugin as a shared library and activated it through the php.ini. I ran
 'make test' and it seemed to pass all but one (it skipped a test). I
 thought all was well. Unfortunately it wasn't. In the middle of the
 night I woke up to SMS messages from the monitoring that the server
 was going down hard. I got the server back up and found that PHP was
 segfaulting and puking core files everywhere and it filled up the
 drive.

 I removed all the core files and restarted the server and it happened
 again. So I removed APC, restarted the server and the core files
 stopped. So just to make sure I put APC back on and saw that PHP
 started dumping again.

 I'm not advanced enough to try and debug the core files but I do know
 enough to try and see what is going on. I used gdb to peer in to a
 core file and saw that libthread_db.1.so or something like that was
 the culprit. Does anyone know what would cause PHP to start
 segfaulting after APC was installed?

 are you using apache and if so, do you have threading enabled?

 -nathan



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



Re: [PHP] PHP OOP

2009-02-10 Thread German Geek
A loosely typed language like PHP might not be the best choice for teaching
OOP, because even though PHP makes it easier with loose types, you should
know about them and how they are stored etc.

PHP is a great language but maybe not strict enough for students to
understand all the errors that can occur. I would recommend encouraging
learning PHP though as it has become both an important and fast and easy
language to program in. For that it's also amazingly fast in execution.

Cheers,
Tim

Tim-Hinnerk Heuer

http://www.ihostnz.com
Garry Shandling  - I'm dating a woman now who, evidently, is unaware of
it.

2009/2/11 tedd tedd.sperl...@gmail.com

 At 9:36 AM -0500 2/10/09, Andrew Ballard wrote:

 On Tue, Feb 10, 2009 at 8:40 AM, Carlos Medina i...@simply-networks.de
 wrote:
   Marcus Gnaß schrieb:

   Hi @ all,

  but this is a php list...

  Regards

  Carlos


 Yes, it is, but the original question was about OOP and not
 specifically about PHP. It seems fair enough to me for someone to ask
 the question on this list since PHP was one of the languages being
 considered, even if consensus among the list seems to be that PHP
 would not be the best choice for teaching a course on OOP.

 Andrew



 Andrew:

 Absolutely, you're not out of line at all.

 TI have found in my life that there will always be those who have a better
 idea, if you know what I mean.

 The point of the post (me being the OP) was to sample other people's
 opinion as to what would be best language to use to teach OOP, and that
 included considering php, thus the relevancy.

 The answer turns out to be Java (1) or C++ (2) depending upon the
 environment and availability of resources.

 Why people have to get on and comment that this is a php list is beyond me,
 duh.

 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] APC problem with PHP

2009-02-10 Thread Nathan Nobbe
On Tue, Feb 10, 2009 at 5:03 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Yes, I'm using Apache 2.2.11 and I do believe that threading could be
 enabled. Apache was compiled through cPanel with Easy::Apache. I
 didn't see any options to disable threading unless I missed it.


a lot of php extensions are not thread safe, perhaps apc is one of them.
most people compile apache w/ mpm_prefork rather than mpm_worker for this
reason.

i know next to nothing about cPanel, thankfully, but youll likely have to
compile php w/ mpm_prefork in order to keep apc from melting down the engine
:)

-nathan


Re: [PHP] APC problem with PHP

2009-02-10 Thread Jamie Krasnoo
I did compile Apache with mpm_prefork though. cPanel does have the
option to compile with all three mpm choices. What else would there be
in Apache that could be using threads? Oh, I failed to mention that
the PHP scripts that are segfaulting are scripts that exist and
haven't been changed for some time. They already exist and are not
using APC at all. As soon as APC is taken off they stop segfauting.

Jamie

On Tue, Feb 10, 2009 at 4:10 PM, Nathan Nobbe quickshif...@gmail.com wrote:
 On Tue, Feb 10, 2009 at 5:03 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Yes, I'm using Apache 2.2.11 and I do believe that threading could be
 enabled. Apache was compiled through cPanel with Easy::Apache. I
 didn't see any options to disable threading unless I missed it.

 a lot of php extensions are not thread safe, perhaps apc is one of them.
 most people compile apache w/ mpm_prefork rather than mpm_worker for this
 reason.

 i know next to nothing about cPanel, thankfully, but youll likely have to
 compile php w/ mpm_prefork in order to keep apc from melting down the engine
 :)

 -nathan



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



Re: [PHP] APC problem with PHP

2009-02-10 Thread Nathan Nobbe
On Tue, Feb 10, 2009 at 5:19 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 I did compile Apache with mpm_prefork though.


hmm, i doubt thats the problem then.  maybe another module not playing nice
w/ apc, xdebug perhaps (just guessing now)?

have you tried other caching solutions like eaccelerator to see if you
encounter the same issue?

-nathan


Re: [PHP] APC problem with PHP

2009-02-10 Thread Jamie Krasnoo
Here's the modules I do have running:

extension=suhosin.so
extension=ffmpeg.so
extension=imagick.so
extension=magickwand.so
extension=memcache.so
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so

[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
zend_optimizer.version=3.3.3


zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

Does APC not play nice with any of these?

Jamie

On Tue, Feb 10, 2009 at 4:25 PM, Nathan Nobbe quickshif...@gmail.com wrote:
 On Tue, Feb 10, 2009 at 5:19 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 I did compile Apache with mpm_prefork though.

 hmm, i doubt thats the problem then.  maybe another module not playing nice
 w/ apc, xdebug perhaps (just guessing now)?

 have you tried other caching solutions like eaccelerator to see if you
 encounter the same issue?

 -nathan



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



Re: [PHP] APC problem with PHP

2009-02-10 Thread Nathan Nobbe
On Tue, Feb 10, 2009 at 5:34 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Here's the modules I do have running:

 extension=suhosin.so
 extension=ffmpeg.so
 extension=imagick.so
 extension=magickwand.so
 extension=memcache.so
 extension=pdo.so
 extension=pdo_sqlite.so
 extension=sqlite.so
 extension=pdo_mysql.so

 [Zend]
 zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
 zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
 zend_optimizer.version=3.3.3


 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
 zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

 Does APC not play nice with any of these?


if i were to guess, those zend_optimizer ones, or less likely, suhosin.

afaik, zend_optimizer and apc arent buddies,

http://www.webdeveloper.com/forum/showthread.php?t=178217

-nathan


Re: [PHP] Re: paging

2009-02-10 Thread Tony Marston

Richard Heyes rich...@php.net wrote in message 
news:af8726440902101100r4d479ddds189b617f06b88...@mail.gmail.com...
 ...

 Are you the same Tony Marston who was on the Demon Internet webmaster
 type mailing list? (I don't remember the actual name).

I doubt it. I don't subscribe to any list with either demon or webmaster 
in its name, although Demon Internet is my ISP.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 -- 
 Richard Heyes

 HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
 http://www.rgraph.org (Updated January 31st) 



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



Re: [PHP] APC problem with PHP

2009-02-10 Thread Jamie Krasnoo
Hmm, I'll try taking down the optimizer and seeing if it segfaults or
not. If that's what it is it's a crying shame that apc and
zend_optimizer can't get along.

On Tue, Feb 10, 2009 at 4:46 PM, Nathan Nobbe quickshif...@gmail.com wrote:
 On Tue, Feb 10, 2009 at 5:34 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Here's the modules I do have running:

 extension=suhosin.so
 extension=ffmpeg.so
 extension=imagick.so
 extension=magickwand.so
 extension=memcache.so
 extension=pdo.so
 extension=pdo_sqlite.so
 extension=sqlite.so
 extension=pdo_mysql.so

 [Zend]
 zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
 zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
 zend_optimizer.version=3.3.3


 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
 zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

 Does APC not play nice with any of these?

 if i were to guess, those zend_optimizer ones, or less likely, suhosin.

 afaik, zend_optimizer and apc arent buddies,

 http://www.webdeveloper.com/forum/showthread.php?t=178217

 -nathan



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



Re: [PHP] APC problem with PHP

2009-02-10 Thread Jamie Krasnoo
Ok, so I removed zend_optimizer and activated apc. Guess what ... no
cores produced. So it is zend_optimizer. I searched around the
archives and there seems to be a consensus that it really doesn't do
much or maybe even not anything at all. So it's gone. I would have
started seeing core files all over the place if it had been something
else.

Jamie

On Tue, Feb 10, 2009 at 4:53 PM, Jamie Krasnoo jkras...@gmail.com wrote:
 Hmm, I'll try taking down the optimizer and seeing if it segfaults or
 not. If that's what it is it's a crying shame that apc and
 zend_optimizer can't get along.

 On Tue, Feb 10, 2009 at 4:46 PM, Nathan Nobbe quickshif...@gmail.com wrote:
 On Tue, Feb 10, 2009 at 5:34 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Here's the modules I do have running:

 extension=suhosin.so
 extension=ffmpeg.so
 extension=imagick.so
 extension=magickwand.so
 extension=memcache.so
 extension=pdo.so
 extension=pdo_sqlite.so
 extension=sqlite.so
 extension=pdo_mysql.so

 [Zend]
 zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
 zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
 zend_optimizer.version=3.3.3


 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
 zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

 Does APC not play nice with any of these?

 if i were to guess, those zend_optimizer ones, or less likely, suhosin.

 afaik, zend_optimizer and apc arent buddies,

 http://www.webdeveloper.com/forum/showthread.php?t=178217

 -nathan




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



Re: [PHP] APC problem with PHP

2009-02-10 Thread Shawn McKenzie
Jamie Krasnoo wrote:
 Ok, so I removed zend_optimizer and activated apc. Guess what ... no
 cores produced. So it is zend_optimizer. I searched around the
 archives and there seems to be a consensus that it really doesn't do
 much or maybe even not anything at all. So it's gone. I would have
 started seeing core files all over the place if it had been something
 else.
 
 Jamie
 
 On Tue, Feb 10, 2009 at 4:53 PM, Jamie Krasnoo jkras...@gmail.com wrote:
 Hmm, I'll try taking down the optimizer and seeing if it segfaults or
 not. If that's what it is it's a crying shame that apc and
 zend_optimizer can't get along.

 On Tue, Feb 10, 2009 at 4:46 PM, Nathan Nobbe quickshif...@gmail.com wrote:
 On Tue, Feb 10, 2009 at 5:34 PM, Jamie Krasnoo jkras...@gmail.com wrote:
 Here's the modules I do have running:

 extension=suhosin.so
 extension=ffmpeg.so
 extension=imagick.so
 extension=magickwand.so
 extension=memcache.so
 extension=pdo.so
 extension=pdo_sqlite.so
 extension=sqlite.so
 extension=pdo_mysql.so

 [Zend]
 zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
 zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
 zend_optimizer.version=3.3.3


 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
 zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

 Does APC not play nice with any of these?
 if i were to guess, those zend_optimizer ones, or less likely, suhosin.

 afaik, zend_optimizer and apc arent buddies,

 http://www.webdeveloper.com/forum/showthread.php?t=178217

 -nathan



Damn it!

$ mount woman
mount: can't find woman in /etc/fstab or /etc/mtab

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] APC problem with PHP

2009-02-10 Thread Nathan Nobbe
On Tue, Feb 10, 2009 at 5:53 PM, Jamie Krasnoo jkras...@gmail.com wrote:

 Hmm, I'll try taking down the optimizer and seeing if it segfaults or
 not. If that's what it is it's a crying shame that apc and
 zend_optimizer can't get along.


maybe give eaccelerator a shot, i believe theyve got an optimizer in there.
im not sure how it stacks up to zend's, but it will do both caching and
optimization, afaik.  also, you will find a not yet stable optimization
extension haging out in pecl for apc,

http://pecl.php.net/package/optimizer

-nathan


[PHP] (Perl) Regular Expressions - oposite match or get the non-matches of a substring

2009-02-10 Thread German Geek
Hi all,

I consider myself quite good with Regular Expression, but i could never find
out how to match something like:

match this but not this and that

so i would like to match the first match this (or another this) but not
not this.

Seems pretty straight forward but i haven't found a (good) solution yet.
Please no solutions with extra code, i know how to do that. I need a regular
expression that can do it, preferably Perl compatible. Surprisingly i
couldn't figure out how to say '/!(not) this/'. Seems like there must be a
simple way, but i can't seem to figure it out.

Tried things like: '/[^n][^o][^t] this/', '/[^not]{3} this/' etc but all of
those don't work. Looked in various books and websites but didn't find what
i was looking for...

Please enlighten me if you can.

Regards,
Tim

Tim-Hinnerk Heuer

http://www.ihostnz.com
Bob Hope  - I have a wonderful make-up crew. They're the same people
restoring the Statue of Liberty.


Re: [PHP] Re: Looking for some PHP OO programming guides

2009-02-10 Thread German Geek
I try to avoid nesting loops altogether if possible. Usually dont go beyond
3 levels of nesting...
How can you require 8 levels of nesting? surely there must be something
wrong or a more efficient algorithm...

Tim-Hinnerk Heuer

http://www.ihostnz.com
Garry Shandling  - I'm dating a woman now who, evidently, is unaware of
it.

2009/2/11 Andrew Ballard aball...@gmail.com

 On Tue, Feb 10, 2009 at 3:09 PM, Kyle Terry k...@kyleterry.com wrote:
  On Tue, Feb 10, 2009 at 12:07 PM, Kyle Terry k...@kyleterry.com wrote:
  On Tue, Feb 10, 2009 at 9:46 AM, Tony Marston
  t...@marston-home.demon.co.uk wrote:
  Take a look at
 http://www.tonymarston.net/php-mysql/databaseobjects.html
 
  --
  Tony Marston
  http://www.tonymarston.net
  http://www.radicore.org
 
  Michael Kubler mdk...@gmail.com wrote in message
  news:49918ebf.4070...@gmail.com...
  Hi,
  I'm just getting into programming in an Object Oriented fashion, and
 am
  looking for some guides, tutorials, hints, tips, etc...
 
  I only just found out that you remove the $ from variables when
 calling
  them from $this-
 
  e.g :
  ?php
  class People
  {
  private $person = not set;
 function __construct()
 {
  *$person* = A person; //This doesn't work (well it creates a
  variable $person that only has the scope of the current function from
  what I can gather)..
  $this-*person* = A person; //This works properly
  }
 function display_list()
 {
 echo $person; //This doesn't work
   echo $this-person; //This works.
 }
  }
 
  $person= new People;
  $person-display_list();
  ?
 
 
  Instead of painstakingly working out most of the other mistakes I'm
  likely to make, I'd love to read about other peoples issues they had
  with learning OO so I can skip most of the hard stuff, and only make
  small mistakes (hopefully).
  --
 
  Michael Kubler
  *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
  Don't next 8 foreach loops in OOP.
 
  --
  Kyle Terry | www.kyleterry.com
  Help kick start VOOM (Very Open Object Model) for a library of PHP
 classes.
  http://www.voom.me | IRC EFNet #voom
 
 
  Don't neSt 8 foreach loops in OOP.

 Yikes! I'd try my best to avoid nesting 8 foreach loops in procedural code,
 too.

  --
  Kyle Terry | www.kyleterry.com
  Help kick start VOOM (Very Open Object Model) for a library of PHP
 classes.
  http://www.voom.me | IRC EFNet #voom
 

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