php-general Digest 15 Dec 2009 13:44:52 -0000 Issue 6489

Topics (messages 300506 through 300519):

Re: Class not functioning
        300506 by: Nirmalya Lahiri

Re: PHP + ODBC
        300507 by: James McLean

Re: MySQL Appeal from Monty
        300508 by: Joseph Masoud
        300509 by: Lester Caine
        300517 by: Ashley Sheridan

Re: PHP live chat
        300510 by: Angelo Zanetti
        300511 by: Ghodmode
        300519 by: Angelo Zanetti

Re: Best ajax library
        300512 by: Ali Asghar Toraby Parizy
        300513 by: Joseph Masoud

Re: ErrorException and set_exception_handler()
        300514 by: Richard Quadling

Parsing JSON; back-slash problem
        300515 by: Andrew Burgess
        300518 by: Ashley Sheridan

Debian Lenny: Which 5.3 package should I use?
        300516 by: Wouter van Vliet / Interpotential

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


----------------------------------------------------------------------
--- Begin Message ---
--- On Tue, 12/15/09, Allen McCabe <allenmcc...@gmail.com> wrote:

> From: Allen McCabe <allenmcc...@gmail.com>
> Subject: [PHP] Class not functioning
> To: "phpList" <php-gene...@lists.php.net>
> Date: Tuesday, December 15, 2009, 6:17 AM
> Hey everyone, I just delved into
> classes recently and have been having
> moderate success so far.
> 
> I have a puzzler though.
> 
> I have the following class decalred and instantiated:
> 
> class Notify {
>  var $q = array();
> 
>  public function addtoQ($string, $class)
>  {
>   $message = '<span class="'. $class .'">'.
> $string .'</span>';
>   $this->q[] = $message;
>  }
> 
>  public function printQ()
>  {
>   if (isset($q))
>   {
>    echo '<p align="center"
> class="notification">';
>    foreach($this->q as $msg)
>    {
>     echo $msg ."\n";
>    }
>    echo '</p>';
>   }
> 
>   return;
>  }
> 
>  function __destruct()
>  {
>   if (isset($q))
>   {
>    unset($this->q);
>   }
>  }
> } // END CLASS Notify
> 
> 
> And in my script, I call it like so:
> $Notif = new Notify;
> 
> I have run other statements in other classes that should be
> adding to the $q
> array (ie. Notify::addtoQ('ERROR! There Was An Error
> Updating The
> Database!', 'error');)
> 
> However, when I try to get my webpage to display them
> using:
> 
> $Notify->printQ();
> 
> it does not seem to want to loop through this array (and
> print the
> messages). I am getting NO error message, in fact
> everything 'looks' fine,
> I'm just not seeing the appropriate message.
> 
> Any help would be appreicated!
> 

Allen,
 You have made a small typing mistake in function printQ() where you would like 
to checked the array for its existence. By mistake you have wrote "if 
(isset($q))". But your array variable is not an freely accessible array,the 
array is embedded into an object. So, you have to write the like "if 
(isset($this->q))".

 Another point, you can't add a message into the array by calling the member 
function addtoQ() using scope resolution operator "::". If you really want to 
add message into the array, you have to call the member function from within 
the object. (ie. $Notif->addtoQ('ERROR! There Was An Error Updating The 
Database!', 'error');).

---
নির্মাল্য লাহিড়ী [Nirmalya Lahiri]
+৯১-৯৪৩৩১১৩৫৩৬ [+91-9433113536]





--- End Message ---
--- Begin Message ---
On Tue, Dec 15, 2009 at 10:03 AM, Philip Thompson
<philthath...@gmail.com> wrote:
> My head hurts from hitting it on my desk all day, so I thought I'd turn to a 
> fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I 
> can get it to work using isql from the command line. Can you verify my 
> settings....:
>
[snipped]
>
> I've tried the above DSNs and many other versions of it ad nauseum. The 
> specific error I'm getting is... "[unixODBC][Driver Manager]Data source name 
> not found, and no default driver specified." I really have searched high and 
> low for a solution, but to no avail. Any thoughts?

Why not just use the built in MySQL libraries or PDO?

--- End Message ---
--- Begin Message --- On 14 Dec 2009, at 22:01, Ashley Sheridan <a...@ashleysheridan.co.uk> wrote:

On Mon, 2009-12-14 at 15:59 -0600, Philip Thompson wrote:

On Dec 14, 2009, at 12:51 AM, Lester Caine wrote:

Lenin wrote:
You might also like this:
Come on Monty - Lukas Smith http://bit.ly/5lmwwD

I've been watching some of this debate with interest, but I'll stay with a database that has none of the baggage that MySQL has always had, and IS currently replacing Oracle in many large sites :)

--
Lester Caine - G8HFL

Do share your db of interest... (and please don't say MSSQL).

~Philip




MSSQL has nearly brought me to tears and could have easily made me bald
through hair pulling!

I have to say, I do like MySQL, it's very flexible and fast, and being
able to choose different storage engines for different tables in the
same DB is brilliant! I really don't think there's anything to overly
worry about from Oracle, as the two DB's have different audiences.

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


Unfortunately, I do not share your optimism. I believe that Oracle taking over MySQL would be a disaster of epic proportions.

The "different audiences" theory has been bought up several times but I haven't [to date] seen a sound justification for it. Oracle wants everyone to use ... Oracle, I can't see how this "different audiences" theory is going to make Oracle promote MySQL, perhaps someone can tell me?

I don't think the EU would be able to do anything about it. The powerful companies almost always get what they want.

I don't think Monty wouldn't be doing this unless he felt that something [put mildly] bad is coming.

What has happened, has happened. Trying to figure out who is to blame for this mess is pointless. Ideally, It would be nice if Oracle took its claws off MySQL and found another project to ruin.

Note: I am *not* trying to spread FUD

--- End Message ---
--- Begin Message ---
Philip Thompson wrote:
On Dec 14, 2009, at 12:51 AM, Lester Caine wrote:

Lenin wrote:
You might also like this:
Come on Monty - Lukas Smith http://bit.ly/5lmwwD
I've been watching some of this debate with interest, but I'll stay with a 
database that has none of the baggage that MySQL has always had, and IS 
currently replacing Oracle in many large sites :)

--
Lester Caine - G8HFL

Do share your db of interest... (and please don't say MSSQL).

It's on my sig ....
Firebird
It was Jim Starkey who wrote the original code for it and who MySQL poached to try and create a version of MySQL with the same power. Something which has not been completed.
I've been running Firebird since it's closed source Interbase days last century!

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
On Tue, 2009-12-15 at 02:53 +0000, Joseph Masoud wrote:

> On 14 Dec 2009, at 22:01, Ashley Sheridan <a...@ashleysheridan.co.uk>  
> wrote:
> 
> > On Mon, 2009-12-14 at 15:59 -0600, Philip Thompson wrote:
> >
> >> On Dec 14, 2009, at 12:51 AM, Lester Caine wrote:
> >>
> >>> Lenin wrote:
> >>>> You might also like this:
> >>>> Come on Monty - Lukas Smith http://bit.ly/5lmwwD
> >>>
> >>> I've been watching some of this debate with interest, but I'll  
> >>> stay with a database that has none of the baggage that MySQL has  
> >>> always had, and IS currently replacing Oracle in many large sites :)
> >>>
> >>> -- 
> >>> Lester Caine - G8HFL
> >>
> >> Do share your db of interest... (and please don't say MSSQL).
> >>
> >> ~Philip
> >>
> >>
> >
> >
> > MSSQL has nearly brought me to tears and could have easily made me  
> > bald
> > through hair pulling!
> >
> > I have to say, I do like MySQL, it's very flexible and fast, and being
> > able to choose different storage engines for different tables in the
> > same DB is brilliant! I really don't think there's anything to overly
> > worry about from Oracle, as the two DB's have different audiences.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> Unfortunately, I do not share your optimism.  I believe that Oracle  
> taking over MySQL would be a disaster of epic proportions.
> 
> The "different audiences" theory has been bought up several times but  
> I haven't [to date] seen a sound justification for it. Oracle wants  
> everyone to use ... Oracle, I can't see how this "different audiences"  
> theory is going to make Oracle promote MySQL, perhaps someone can tell  
> me?
> 
> I don't think the EU would be able to do anything about it.  The  
> powerful companies almost always get what they want.
> 
> I don't think Monty wouldn't be doing this unless he felt that  
> something [put mildly] bad is coming.
> 
> What has happened, has happened.  Trying to figure out who is to blame  
> for this mess is pointless. Ideally, It would be nice if Oracle took  
> its claws off MySQL and found another project to ruin.
> 
> Note: I am *not* trying to spread FUD


I've always been led to believe that you go with MySQL if you want
speed, Oracle if you want data integrity. I know they both handle each
one admirably, but Oracle is known more for guarding the data against
mishaps and MySQL is known more for performance. I just think it may be
a little early to be condemning Oracle yet, we should wait a little to
at least see what stance they have on the whole thing. And before you
ask, no I have no connection to Oracle, I'm an avid MySQL fan!

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



--- End Message ---
--- Begin Message ---

-----Original Message-----
From: Philip Thompson [mailto:philthath...@gmail.com] 
Sent: 15 December 2009 12:01 AM
To: Angelo Zanetti
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] PHP live chat

On Dec 14, 2009, at 2:14 AM, Angelo Zanetti wrote:

> Hi all, 
> 
> I know there are a lot of scripts that one can pay for, for "live chat" -
> website support.
> 
> Are there are any free open source ones that work well?
> 
> I found: www.phplivechat.com
> 
> But still waiting to evaluate it.
> 
> Please send you comments, good or bad and what you would recommend or not
> recommend and why
> 
> Thanks in advance.
> 
> Angelo

We used phplivechat at my last company. I'm pretty sure I was the one who
set it up, and I don't remember hating it. It seemed to work pretty reliably
and our customers seemed to have enjoyed it. I'd recommend it.

~Philip=


Thanks Philip. 
I will look into it!

Regards
Angelo

http://www.elemental.co.za
http://www.wapit.co.za


--- End Message ---
--- Begin Message --- I've played around with CraftySyntax LiveHelp, but I haven't deployed it in a production environment. It definitely looks like it's worth a try, though.

http://www.craftysyntax.com/

On 14/12/09 21:14, Angelo Zanetti wrote:
Hi all,
I know there are a lot of scripts that one can pay for, for "live chat" -
website support.

Are there are any free open source ones that work well?

I found: www.phplivechat.com

But still waiting to evaluate it.

Please send you comments, good or bad and what you would recommend or not
recommend and why

Thanks in advance.

Angelo


http://www.wapit.co.za
http://www.elemental.co.za

--
*Vince Aggrippino*
a.k.a. Ghodmode
www.ghodmode.com <http://www.ghodmode.com>

--- End Message ---
--- Begin Message ---

-----Original Message-----
From: Ghodmode [mailto:ghodm...@ghodmode.com] 
Sent: 15 December 2009 09:41 AM
To: php-gene...@lists.php.net
Subject: Re: [PHP] PHP live chat

I've played around with CraftySyntax LiveHelp, but I haven't deployed it 
in a production environment.  It definitely looks like it's worth a try, 
though.

http://www.craftysyntax.com/



thanks Ghomode, I will have a look at it now.

Regards
Angelo

http://www.elemental.co.za
http://www.wapit.co.za




On 14/12/09 21:14, Angelo Zanetti wrote:
> Hi all,
> I know there are a lot of scripts that one can pay for, for "live chat" -
> website support.
>
> Are there are any free open source ones that work well?
>
> I found: www.phplivechat.com
>
> But still waiting to evaluate it.
>
> Please send you comments, good or bad and what you would recommend or not
> recommend and why
>
> Thanks in advance.
>
> Angelo
>
>
> http://www.wapit.co.za
> http://www.elemental.co.za
>    

-- 
*Vince Aggrippino*
a.k.a. Ghodmode
www.ghodmode.com <http://www.ghodmode.com>


--- End Message ---
--- Begin Message ---
Which one is more active than others? I mean which project extends
faster and better, in future?

On Tue, Dec 15, 2009 at 1:37 AM, Philip Thompson <philthath...@gmail.com> wrote:
> On Dec 14, 2009, at 4:27 AM, Ali Asghar Toraby Parizy wrote:
>
>> Hi
>> I think the best choice is jquery until now.
>> But, is it reasonable to combine jquery and other library to client
>> side and server side scripting respectively?
>> By the way, where i can find good lessons about jquery and php?
>
> I really like this js library.
>
> http://mootools.net/
>
> It's based off of jquery or prototype... I can't remember.
>
> ~Philip
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message --- On 15 Dec 2009, at 08:50, Ali Asghar Toraby Parizy <aliasghar.tor...@gmail.com > wrote:

Which one is more active than others? I mean which project extends
faster and better, in future?

On Tue, Dec 15, 2009 at 1:37 AM, Philip Thompson <philthath...@gmail.com > wrote:
On Dec 14, 2009, at 4:27 AM, Ali Asghar Toraby Parizy wrote:

Hi
I think the best choice is jquery until now.
But, is it reasonable to combine jquery and other library to client
side and server side scripting respectively?
By the way, where i can find good lessons about jquery and php?

I really like this js library.

http://mootools.net/

It's based off of jquery or prototype... I can't remember.

~Philip

--
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

JQuery and Mootools are two very different approaches of creating a JavaScript framework. Both shine in different ways.

I use JQuery when I want to get things done quickly (using the Yii framework or on custom projects). I use mootols when I develop Joomla! Extensions and it's amazing. Which is more suitable boils down to what your project needs.

I'm messing around with Ext at the moment and it's really nice too!

The ultimate answer to your question is; "it depends".
--- End Message ---
--- Begin Message ---
---------- Forwarded message ----------
From: Randall Girard <randallgir...@hotmail.com>
Date: 2009/12/14
Subject: RE: [PHP] Re: ErrorException and set_exception_handler()
To: rquadl...@googlemail.com


I understood exactly what was going on in the code! (I'm no fool when
it comes to this) I just thought (logically) that if the ERROR_HANDLER
forces you to end the script when necessary, that the
EXCEPTION_HANDLER would have a similar function... Rather, there is
not a way at all to continue execution. Now that I contemplate this
further, I think I prefer this anyway as I would NOT want errors
firing for ANY reason on a production website! Additionally when one
error happens it often triggers a number of errors (if execution
continues) and when logging of course they are all logged. I would
rather have just the one backtraced error log, and so forth.


Thank you for your help however! It is much appreciated.

--- End Message ---
--- Begin Message ---
This seems like a pretty basic question, but it has me stumped.

Here's my scenario: I'm using Douglas Crockford's JSON2.js to parse an
object in JavaScript, which I then pass to a PHP script to store in a
file. I use JSON.stringify() on the object, which logs to the console
as this:

{"employees":{"data":{"John":{"fname":"John","lname":"Doe","city":"Toronto","country":"Canada"}}}}

Then I use the jQuery POST function to send it to a PHP script. Before
doing anything with it in PHP, I log the received value to the
console, and this is what I get:

{\"employees\":{\"data\":{\"John\":{\"fname\":\"John\",\"lname\":\"Doe\",\"city\":\"Toronto\",\"country\":\"Canada\"}}}}

The problem is, when I call the script to retrieve this data from a
file, JSON.parse can't parse it because of the back-slashes. I'm
pretty sure my problem is on the PHP side (since it's fine coming out
of JS); what do I need to do to fix this? is a preg_replace enough?

--- End Message ---
--- Begin Message ---
On Tue, 2009-12-15 at 06:52 -0500, Andrew Burgess wrote:

> This seems like a pretty basic question, but it has me stumped.
> 
> Here's my scenario: I'm using Douglas Crockford's JSON2.js to parse an
> object in JavaScript, which I then pass to a PHP script to store in a
> file. I use JSON.stringify() on the object, which logs to the console
> as this:
> 
> {"employees":{"data":{"John":{"fname":"John","lname":"Doe","city":"Toronto","country":"Canada"}}}}
> 
> Then I use the jQuery POST function to send it to a PHP script. Before
> doing anything with it in PHP, I log the received value to the
> console, and this is what I get:
> 
> {\"employees\":{\"data\":{\"John\":{\"fname\":\"John\",\"lname\":\"Doe\",\"city\":\"Toronto\",\"country\":\"Canada\"}}}}
> 
> The problem is, when I call the script to retrieve this data from a
> file, JSON.parse can't parse it because of the back-slashes. I'm
> pretty sure my problem is on the PHP side (since it's fine coming out
> of JS); what do I need to do to fix this? is a preg_replace enough?
> 


Turn off magic quotes, as it looks like they are enabled on your server.
You can turn them off from the .htaccess file if you don't have access
to the php.ini

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



--- End Message ---
--- Begin Message ---
Hi Guys & Gals,

I've been playing around with PHP 5.3 for a while now on development servers
and servers solely used for start-ups and lower-profile apps. But now I'm
about to upgrade the servers for a high profile/high traffic website and
with this upgrade I'd also like to make the switch from 5.2 to 5.3. But -
which package should I choose? I want to rely on community tested builds, so
compiling myself is out of the question.

The server will run on Debian Lenny. The Two and a Half options I've been
able to find are:

  DotDeb:
http://www.dotdeb.org/2009/12/06/the-php-5-3-1-packages-have-been-updated/
  Debian Experimental: http://packages.debian.org/source/experimental/php5
  ~raaa Launchpad: https://launchpad.net/~raaa/+archive/ppa

Are there any others? Which is the best when it comes to:

   - Security?
   - Stability?
   - Ease of upgrade to Debian Squeeze later next year?

Thanks in advance for any help you're able to offer!

Regards,
Wouter

-- 
http://www.interpotential.com
http://www.ilikealot.com

Phone: +4520371433

--- End Message ---

Reply via email to