php-general Digest 30 Jun 2009 10:33:10 -0000 Issue 6203

2009-06-30 Thread php-general-digest-help

php-general Digest 30 Jun 2009 10:33:10 - Issue 6203

Topics (messages 294723 through 294731):

Re: Named pair array from variable
294723 by: Ashley Sheridan
294724 by: Shawn McKenzie
294725 by: Shawn McKenzie

Re: Best way to reinstate radio-button states from database?
294726 by: Michael A. Peters

Re: guide me please
294727 by: Michael A. Peters

Re: Does something like this exist?
294728 by: Nathan Nobbe

Scope woe
294729 by: Luke

Push an Array, Comma separated.
294730 by: Louie Miranda
294731 by: Richard Heyes

Administrivia:

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

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

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


--
---BeginMessage---
On Mon, 2009-06-29 at 12:06 -0700, Mikey Knutson wrote:
 Is this even possible?  I'm building a string, properly formatted, to create 
 a named pair or associative array.   The string is fine, and when I use it 
 directly to create the array, all is well.  When I try to use the var to 
 create the array, I get an empty array (I think).  Huh?
 
 Here is what I have:
 
 $myString = 'username' = 'password' , 'mickey' = 'mouse' , 'donald' = 
 'duck';
 $myArray = array($myString);
 print (array val: $myArray[username]);   // get an empty string here
 
 
 
 
What you're doing is assigning the string 'username' = 'password' ,
'mickey' = 'mouse' , 'donald' = 'duck' to the first index of the
array. What you should be doing is assigning the elements one by one to
the array so that they have proper indexes.

Thanks
Ash
www.ashleysheridan.co.uk

---End Message---
---BeginMessage---
Mikey Knutson wrote:
 Is this even possible?  I'm building a string, properly formatted, to create 
 a named pair or associative array.   The string is fine, and when I use it 
 directly to create the array, all is well.  When I try to use the var to 
 create the array, I get an empty array (I think).  Huh?
 
 Here is what I have:
 
 $myString = 'username' = 'password' , 'mickey' = 'mouse' , 'donald' = 
 'duck';
 $myArray = array($myString);
 print (array val: $myArray[username]);   // get an empty string here
 
 
 

AFAIK you can't do what you're showing.  This will work, but is not advised:

eval('$myArray = array(' . $myString . ');');
print (array val: $myArray[username]);   // array val: password

Why are you needing to store the array indexes and values in a string
like this?  Maybe we can give you an alternative approach.

-- 
Thanks!
-Shawn
http://www.spidean.com
---End Message---
---BeginMessage---
Shawn McKenzie wrote:
 Mikey Knutson wrote:
 Is this even possible?  I'm building a string, properly formatted, to create 
 a named pair or associative array.   The string is fine, and when I use it 
 directly to create the array, all is well.  When I try to use the var to 
 create the array, I get an empty array (I think).  Huh?

 Here is what I have:

 $myString = 'username' = 'password' , 'mickey' = 'mouse' , 'donald' = 
 'duck';
 $myArray = array($myString);
 print (array val: $myArray[username]);   // get an empty string here



 
 AFAIK you can't do what you're showing.  This will work, but is not advised:
 
 eval('$myArray = array(' . $myString . ');');
 print (array val: $myArray[username]);   // array val: password
 
 Why are you needing to store the array indexes and values in a string
 like this?  Maybe we can give you an alternative approach.
 

Unless I'm way off you might like serialize()


-- 
Thanks!
-Shawn
http://www.spidean.com
---End Message---
---BeginMessage---

Rob Gould wrote:
I have a webpage which allows people to log in and make selections with 
radio buttons and hit SUBMIT and saves the data from those radio buttons 
to a mySQL database.


However, I'm finding that I also need the ability to allow a user to log 
back in at a later date (or even on a different computer), and pull up 
that survey again,
with each of the 50-something radio-buttons back in the positions in 
which they were last saved.


Surely there's a best-case-method for doing this type of thing (saving 
large numbers of radio-button-group settings to mySQL and pulling them back
again later).  Any advice is greatly appreciated.  Perhaps there's a 
jQuery-way to retrieve all the radio-button group settings as an array 
and save it and pull it back again?

Or perhaps a PHP-specific method - - - I'm fine with either.





Generate your radio list via php.
When the value grabbed from database matches the button value, add a 
selected=selected to the radio input.


Works for me.
---End Message---
---BeginMessage---

Suresh Gupta VG wrote:

Hi List,
 
I am newb to this PHP. I am using AIX Version 5.3 OS and PHP version 4.3.9 by default version and Oracle Application Server 10g Release 2. Configured 

[PHP] Scope woe

2009-06-30 Thread Luke
Hello again guys,

I was wondering the best way to tackle the following problem:

I've got a class, containing a property which is another object. So from
outside I should be able to do
$firstobject-propertycontainingobject-methodinsidethatobject();

The $firstobject variable is in the global namespace (having been made with
$firstobject = new FirstObject;), and I'm having a problem that I'm sure
many people have when accessing it inside another class, so:

class otherObject
{
static function messwithotherthings ()
{
$firstobject-propertycontainingobject-methodinsidethatobject();
}
}

But $firstobject is blank, which makes sense because in there it is pointing
to the local variable within the method.

To solve this, I could add 'global $firstobject' inside every method, but
this is very redundant and boring. I've tried a couple of things like
adding:

private $firstobject = $GLOBALS['firstobject'];

But apparently that's bad syntax. I was just wondering the best way to get
around this?

Thanks a lot for your help,

-- 
Luke Slater
:O)


[PHP] Push an Array, Comma separated.

2009-06-30 Thread Louie Miranda
GPS Administrative Page v2.3.12 (BETA)My array:
Array ( [0] = Demo2.txt [1] = Demo.txt [2] = Demo.txt )

How could I push the values as:

- Demo2.txt, Demo.txt, Demo.txt?

Not sure which approach is good.

$saveFiles = array();
array_push($saveFiles, $ufName);

Help
--
Louie Miranda (lmira...@gmail.com)
http://www.louiemiranda.net

Quality Web Hosting - www.axishift.com
Pinoy Web Hosting, Web Hosting Philippines


Re: [PHP] Push an Array, Comma separated.

2009-06-30 Thread Richard Heyes
 My array:
 Array ( [0] = Demo2.txt [1] = Demo.txt [2] = Demo.txt )

 How could I push the values as:

 - Demo2.txt, Demo.txt, Demo.txt?

 Not sure which approach is good.

 $saveFiles = array();
 array_push($saveFiles, $ufName);

you could use array_push(), or the shorter syntax:

 o array_push();

array_push($myArr, 'Demo2.txt', 'Demo.txt', 'Demo.txt');

 o Shorter syntax:

$myArr[] = 'Demo2.txt';
$myArr[] = 'Demo.txt';
$myArr[] = 'Demo.txt';

-- 
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 20th June)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp

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



RE: [PHP] guide me please

2009-06-30 Thread Suresh Gupta VG
Hi All,
 
Should I need to install php5.X version. If so, can you please give me the link 
where I can get the source for AIX and install over php4.X. 
 
Secondly, I used a simple code as below to get the output, but now, it gives 
blank page.
html
 head
  titlePHP Test/title
 /head
 body
 ?php echo 'pHello World/p'; ? 
 /body
/html 
 
 
pls advice.
 
With thanks and Regards, 
Suresh.G
Zensar Technologies Ltd. 
Cell - +91 9890898688



From: Yuri Yarlei [mailto:gargari...@hotmail.com]
Sent: Mon 6/29/2009 9:39 PM
To: Suresh Gupta VG; php-general@lists.php.net
Subject: RE: [PHP] guide me please


Hi,

My suggestion is you install a better version of PHP or use other type of php 
server, you will use oracle db?  If is not necessary, you should use mysql or 
postgresql for learn php.
But this error maybe happen because you are using '?' '?' for php tags, 
if you use '?php'  '?'  maybe this error will go away

Yuri Yarlei.
Programmer PHP, CSS, Java, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.



 Date: Mon, 29 Jun 2009 15:10:22 +0530
 From: sures...@zensar.com
 To: php-general@lists.php.net
 Subject: [PHP] guide me please
 
 Hi List,
 
 I am newb to this PHP. I am using AIX Version 5.3 OS and PHP version 
 4.3.9 by default version and Oracle Application Server 10g Release 2. 
 Configured properly and I am getting the phpinfo.php on browser properly. But 
 when I write my own code for php, it is just displaying the code but it is 
 not running the php code.
 
 Is there any mistake in configuring the apache or else where? pls guide me. 
 
 With thanks and Regards, 
 Suresh.G
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 




Conheça os novos produtos Windows Live. Clique aqui! 
http://www.windowslive.com.br/  

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



[PHP] Re: Push an Array, Comma separated.

2009-06-30 Thread Jo�o C�ndido de Souza Neto
May be array_merge($array, explode(,, $string)).

-- 
João Cândido de Souza Neto
SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS
Fone: (0XX41) 3033-3636 - JS
www.siens.com.br

Louie Miranda lmira...@gmail.com escreveu na mensagem 
news:5016fc50906300125s12389ae1v3323c63c30343...@mail.gmail.com...
 GPS Administrative Page v2.3.12 (BETA)My array:
 Array ( [0] = Demo2.txt [1] = Demo.txt [2] = Demo.txt )

 How could I push the values as:

 - Demo2.txt, Demo.txt, Demo.txt?

 Not sure which approach is good.

 $saveFiles = array();
 array_push($saveFiles, $ufName);

 Help
 --
 Louie Miranda (lmira...@gmail.com)
 http://www.louiemiranda.net

 Quality Web Hosting - www.axishift.com
 Pinoy Web Hosting, Web Hosting Philippines
 



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



[PHP] Re: Scope woe

2009-06-30 Thread Jo�o C�ndido de Souza Neto
I think the best way is passing the object instance as a parameter to the 
messwithotherthings method.

-- 
João Cândido de Souza Neto
SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS
Fone: (0XX41) 3033-3636 - JS
www.siens.com.br

Luke l...@blog-thing.com escreveu na mensagem 
news:17aa29670906300114t5b95c12dk9dfdfbdfdd7f0...@mail.gmail.com...
 Hello again guys,

 I was wondering the best way to tackle the following problem:

 I've got a class, containing a property which is another object. So from
 outside I should be able to do
 $firstobject-propertycontainingobject-methodinsidethatobject();

 The $firstobject variable is in the global namespace (having been made 
 with
 $firstobject = new FirstObject;), and I'm having a problem that I'm sure
 many people have when accessing it inside another class, so:

 class otherObject
 {
 static function messwithotherthings ()
 {
 $firstobject-propertycontainingobject-methodinsidethatobject();
 }
 }

 But $firstobject is blank, which makes sense because in there it is 
 pointing
 to the local variable within the method.

 To solve this, I could add 'global $firstobject' inside every method, but
 this is very redundant and boring. I've tried a couple of things like
 adding:

 private $firstobject = $GLOBALS['firstobject'];

 But apparently that's bad syntax. I was just wondering the best way to get
 around this?

 Thanks a lot for your help,

 -- 
 Luke Slater
 :O)
 



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



[PHP] Re: Scope woe

2009-06-30 Thread Peter Ford
Luke wrote:
 Hello again guys,
 
 I was wondering the best way to tackle the following problem:
 
 I've got a class, containing a property which is another object. So from
 outside I should be able to do
 $firstobject-propertycontainingobject-methodinsidethatobject();
 
 The $firstobject variable is in the global namespace (having been made with
 $firstobject = new FirstObject;), and I'm having a problem that I'm sure
 many people have when accessing it inside another class, so:
 
 class otherObject
 {
 static function messwithotherthings ()
 {
 $firstobject-propertycontainingobject-methodinsidethatobject();
 }
 }
 
 But $firstobject is blank, which makes sense because in there it is pointing
 to the local variable within the method.
 
 To solve this, I could add 'global $firstobject' inside every method, but
 this is very redundant and boring. I've tried a couple of things like
 adding:
 
 private $firstobject = $GLOBALS['firstobject'];
 
 But apparently that's bad syntax. I was just wondering the best way to get
 around this?
 
 Thanks a lot for your help,
 


Set the value of $firstobject in the constructor of otherObject (that's what
constructors are for!):

eg.

class otherObject
{
private $firstobject;

function __construct()
{
$this-firstobject = $GLOBALS['firstobject'];
}

static function messwithotherthings ()
{
$this-firstobject-propertycontainingobject-methodinsidethatobject();
}
}


-- 
Peter Ford  phone: 01580 89
Developer   fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
It should be passed into the constructor as a parameter.  If you're
using OOP properly, there's no reason to use $GLOBALS, ever.  Any
variable in the $GLOBALS array exists twice in memory, so just keep
that in mind, if you plan to use it.

On Tue, Jun 30, 2009 at 8:43 AM, Peter Fordp...@justcroft.com wrote:
 Luke wrote:
 Hello again guys,

 I was wondering the best way to tackle the following problem:

 I've got a class, containing a property which is another object. So from
 outside I should be able to do
 $firstobject-propertycontainingobject-methodinsidethatobject();

 The $firstobject variable is in the global namespace (having been made with
 $firstobject = new FirstObject;), and I'm having a problem that I'm sure
 many people have when accessing it inside another class, so:

 class otherObject
 {
 static function messwithotherthings ()
 {
 $firstobject-propertycontainingobject-methodinsidethatobject();
 }
 }

 But $firstobject is blank, which makes sense because in there it is pointing
 to the local variable within the method.

 To solve this, I could add 'global $firstobject' inside every method, but
 this is very redundant and boring. I've tried a couple of things like
 adding:

 private $firstobject = $GLOBALS['firstobject'];

 But apparently that's bad syntax. I was just wondering the best way to get
 around this?

 Thanks a lot for your help,



 Set the value of $firstobject in the constructor of otherObject (that's what
 constructors are for!):

 eg.

 class otherObject
 {
    private $firstobject;

    function __construct()
    {
        $this-firstobject = $GLOBALS['firstobject'];
    }

    static function messwithotherthings ()
    {
        $this-firstobject-propertycontainingobject-methodinsidethatobject();
    }
 }


 --
 Peter Ford                              phone: 01580 89
 Developer                               fax:   01580 893399
 Justcroft International Ltd., Staplehurst, Kent

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



[PHP] PHP 5.3.0 Released!

2009-06-30 Thread Lukas Kahwe Smith

Hello!

The PHP Development Team would like to announce the immediate release  
of PHP 5.3.0. This release is a major improvement in the 5.X series,  
which includes a large number of new features and bug fixes.


Release Announcement: http://www.php.net/release/5_3_0.php
Downloads:http://php.net/downloads.php#v5.3.0
Changelog:http://www.php.net/ChangeLog-5.php#5.3.0

regards,
Johannes and Lukas

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



[PHP] Re: PHP 5.3.0 Released!

2009-06-30 Thread pan
Lukas Kahwe Smith wrote:
 Hello!

 The PHP Development Team would like to announce the immediate release
 of PHP 5.3.0. This release is a major improvement in the 5.X series,
 which includes a large number of new features and bug fixes.

 Release Announcement: http://www.php.net/release/5_3_0.php
 Downloads:http://php.net/downloads.php#v5.3.0
 Changelog:http://www.php.net/ChangeLog-5.php#5.3.0

 regards,
 Johannes and Lukas

Great !

The downloads page is devoid of any note in re pRCL binaries
for Windows.
windows.php.net doesn't say anything either of which pre-existing
PECL binaries will work with 5_3.

Is the 5_2_6 set of PECL binaries compatible with 5_3 ?



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



[PHP] Managed job chains

2009-06-30 Thread Suresh Gupta VG
Hi List,
 
Please find the error message below when I logged into managed jobs. Please 
advice me to get rid of this.
 
 The PHP-Extension domxml is needed to display job scheduler 
informations
Please adjust the setting in the coniguration file php.ini 

repeat status check 
http://10.42.4.52:7785/scheduler2/scheduler.php?action=spooler_statusspooler_host=10.42.4.52spooler_port=49152
  

 
With thanks and Regards, 
Suresh.G
 

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



Re: [PHP] Managed job chains

2009-06-30 Thread Stuart
2009/6/30 Suresh Gupta VG sures...@zensar.com:
 Hi List,

 Please find the error message below when I logged into managed jobs. Please 
 advice me to get rid of this.

         The PHP-Extension domxml is needed to display job scheduler 
 informations
 Please adjust the setting in the coniguration file php.ini

 repeat status check 
 http://10.42.4.52:7785/scheduler2/scheduler.php?action=spooler_statusspooler_host=10.42.4.52spooler_port=49152

I'm assuming you're talking about the job scheduler in Zend Platform.
This is not the place to get support for that. Log in to the Zend
website and raise a support ticket.

However, this particular error message is pretty self-explanatory -
your PHP installation does not have the domxml extension installed, so
you need to install it. How to do that depends greatly on how your
server is set up, but the manual would be a good place to start.

-Stuart

-- 
http://stut.net/

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



Re: [PHP] Managed job chains

2009-06-30 Thread Daniel Brown
On Tue, Jun 30, 2009 at 09:42, Suresh Gupta VGsures...@zensar.com wrote:
 Hi List,

 Please find the error message below when I logged into managed jobs. Please 
 advice me to get rid of this.

Get rid of this.


         The PHP-Extension domxml is needed to display job scheduler 
 informations
 Please adjust the setting in the coniguration file php.ini

Read exactly what the error message says and do that, Suresh.  You
don't have the domxml extension set up on your server.  Fix that,
restart the server, and it'll work.

 repeat status check 
 http://10.42.4.52:7785/scheduler2/scheduler.php?action=spooler_statusspooler_host=10.42.4.52spooler_port=49152


 With thanks and Regards,
 Suresh.G


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





-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Ask me about our fully-managed servers and proactive management
clusters starting at just $200/mo.!

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



[PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion
Okay, what I am trying to do is this:

I have a db full of inspections, daily I need to run a script that will grab
the posting of inspections, check them against the db to make sure they
aren't duplicates and then insert all the new entries. Not sure if my
logic of going about it this way is right, or if I'm off track and need to
be doing something different please advise...so far this is how I am writing
it.and it seems redundant ... Shouldn't there be a way to say (in plain
speak) if there are no records with the name== insert this one, if there is
one with the name then check intype if none ..insert... Etc


 if (!empty($Go)) {

$query = SELECT * FROM restaurants WHERE name LIKE '$ucName';

 $result = mysql_query ($query);

 $row = mysql_fetch_object ($result);


 If (mysql_num_rows($result) == 0) {

$sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
critical, cviolations, noncritical)  VALUES (;

$sql .=  '$ucName', '$ucAddress', '$inDate', '$inType', '$notes',
'$critical', '$cleanViolations', '$noncritical');

$result = mysql_query($sql) or die(mysql_error());


} else {
  
 $query = SELECT * FROM restaurants WHERE inType LIKE '$inType' AND name
LIKE '$ucName' ;
 
  $result = mysql_query ($query);

$row = mysql_fetch_object ($result);

If (mysql_num_rows($result) == 0) {

   $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
critical, cviolations, noncritical)  VALUES (;

 $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
'$notes', '$critical', '$cleanViolations', '$noncritical');

$result = mysql_query($sql) or die(mysql_error());


} else {

  $query = SELECT * FROM restaurants WHERE inDate LIKE '$inDate' AND name
LIKE '$ucName' ;
 
   $result = mysql_query ($query);

   $row = mysql_fetch_object ($result);


  If (mysql_num_rows($result) == 0) {

  $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
critical, cviolations, noncritical)  VALUES (;

   $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
'$notes', '$critical', '$cleanViolations', '$noncritical');


   $result = mysql_query($sql) or die(mysql_error());


   }
}




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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Luke
2009/6/30 Eddie Drapkin oorza...@gmail.com

 It should be passed into the constructor as a parameter.  If you're
 using OOP properly, there's no reason to use $GLOBALS, ever.  Any
 variable in the $GLOBALS array exists twice in memory, so just keep
 that in mind, if you plan to use it.

 On Tue, Jun 30, 2009 at 8:43 AM, Peter Fordp...@justcroft.com wrote:
  Luke wrote:
  Hello again guys,
 
  I was wondering the best way to tackle the following problem:
 
  I've got a class, containing a property which is another object. So from
  outside I should be able to do
  $firstobject-propertycontainingobject-methodinsidethatobject();
 
  The $firstobject variable is in the global namespace (having been made
 with
  $firstobject = new FirstObject;), and I'm having a problem that I'm sure
  many people have when accessing it inside another class, so:
 
  class otherObject
  {
  static function messwithotherthings ()
  {
  $firstobject-propertycontainingobject-methodinsidethatobject();
  }
  }
 
  But $firstobject is blank, which makes sense because in there it is
 pointing
  to the local variable within the method.
 
  To solve this, I could add 'global $firstobject' inside every method,
 but
  this is very redundant and boring. I've tried a couple of things like
  adding:
 
  private $firstobject = $GLOBALS['firstobject'];
 
  But apparently that's bad syntax. I was just wondering the best way to
 get
  around this?
 
  Thanks a lot for your help,
 
 
 
  Set the value of $firstobject in the constructor of otherObject (that's
 what
  constructors are for!):
 
  eg.
 
  class otherObject
  {
 private $firstobject;
 
 function __construct()
 {
 $this-firstobject = $GLOBALS['firstobject'];
 }
 
 static function messwithotherthings ()
 {
 
  $this-firstobject-propertycontainingobject-methodinsidethatobject();
 }
  }
 
 
  --
  Peter Ford  phone: 01580 89
  Developer   fax:   01580 893399
  Justcroft International Ltd., Staplehurst, Kent
 
  --
  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


Thanks for the replies :)

Surely if I pass it as a parameter to the __construct then I would have to
make an instance of the otherObject, notice that messwithotherthings is
static?

Also, if I'm not using OOP properly, Eddie, how would I use it properly to
prevent this situation?

Thanks,

-- 
Luke Slater
:O)


Re: [PHP] Re: PHP 5.3.0 Released!

2009-06-30 Thread Luke
2009/6/30 pan p...@syix.com

 Lukas Kahwe Smith wrote:
  Hello!
 
  The PHP Development Team would like to announce the immediate release
  of PHP 5.3.0. This release is a major improvement in the 5.X series,
  which includes a large number of new features and bug fixes.
 
  Release Announcement: http://www.php.net/release/5_3_0.php
  Downloads:http://php.net/downloads.php#v5.3.0
  Changelog:http://www.php.net/ChangeLog-5.php#5.3.0
 
  regards,
  Johannes and Lukas

 Great !

 The downloads page is devoid of any note in re pRCL binaries
 for Windows.
 windows.php.net doesn't say anything either of which pre-existing
 PECL binaries will work with 5_3.

 Is the 5_2_6 set of PECL binaries compatible with 5_3 ?



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


Did anyone notice it has been released on the same day as firefox 3.5? See
any similarity in the version numbers?

-- 
Luke Slater
:O)


Re: [PHP] Compare and inserting with php

2009-06-30 Thread Ashley Sheridan
On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote:
 Okay, what I am trying to do is this:

 I have a db full of inspections, daily I need to run a script that will
 grab the posting of inspections, check them against the db to make sure
 they aren't duplicates and then insert all the new entries. Not sure if
 my logic of going about it this way is right, or if I'm off track and need
 to be doing something different please advise...so far this is how I am
 writing it.and it seems redundant ... Shouldn't there be a way to say
 (in plain speak) if there are no records with the name== insert this one,
 if there is one with the name then check intype if none ..insert... Etc


  if (!empty($Go)) {

 $query = SELECT * FROM restaurants WHERE name LIKE '$ucName';

  $result = mysql_query ($query);

  $row = mysql_fetch_object ($result);


  If (mysql_num_rows($result) == 0) {

 $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

 $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType', '$notes',
 '$critical', '$cleanViolations', '$noncritical');

 $result = mysql_query($sql) or die(mysql_error());


 } else {

  $query = SELECT * FROM restaurants WHERE inType LIKE '$inType' AND name
 LIKE '$ucName' ;

   $result = mysql_query ($query);

 $row = mysql_fetch_object ($result);

 If (mysql_num_rows($result) == 0) {

$sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

  $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');

 $result = mysql_query($sql) or die(mysql_error());


 } else {

   $query = SELECT * FROM restaurants WHERE inDate LIKE '$inDate' AND name
 LIKE '$ucName' ;

$result = mysql_query ($query);

$row = mysql_fetch_object ($result);


   If (mysql_num_rows($result) == 0) {

   $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

$sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');


$result = mysql_query($sql) or die(mysql_error());


}
 }

It's a bad way of doing it, but could you not create a unique index on the 
particular key you want to be unique, and then just try the select anyway 
with the mysql_query() call preceeded with an @ to suppress warnings?

Thanks,
Ash

http://www.ashleysheridan.co.uk

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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Peter Ford
Luke wrote:

 Thanks for the replies :)
 
 Surely if I pass it as a parameter to the __construct then I would have to
 make an instance of the otherObject, notice that messwithotherthings is
 static?
 
 Also, if I'm not using OOP properly, Eddie, how would I use it properly to
 prevent this situation?
 
 Thanks,
 

Hmmm, I didn't notice the method was static - that means my idea really won't
work...

I did have a bad feeling about this, and Eddie confirmed my unease with the
point about OOP.

Really, you should need your $firstobject to be a singleton:
eg.

class FirstObject
{
private static $theInstance = NULL;

public $propertyContainingObject;

protected function __construct()
{
// whatever
}

public static function getInstance()
{
if (!self::$theInstance)
{
self::$theInstance = new FirstObject();
}
return self::$theInstance;
}

// ... other methods ...
}


So then:

class OtherObject
{
static function messWithOtherThings()
{
$firstObject = FirstObject::getInstance();
$firstObject-propertyContainingObject-methodInsideThatObject();
}
}



I think that works, and is reasonable to the OOP purists...


-- 
Peter Ford  phone: 01580 89
Developer   fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 10:44 AM, Lukel...@blog-thing.com wrote:


 2009/6/30 Eddie Drapkin oorza...@gmail.com

 It should be passed into the constructor as a parameter.  If you're
 using OOP properly, there's no reason to use $GLOBALS, ever.  Any
 variable in the $GLOBALS array exists twice in memory, so just keep
 that in mind, if you plan to use it.

 On Tue, Jun 30, 2009 at 8:43 AM, Peter Fordp...@justcroft.com wrote:
  Luke wrote:
  Hello again guys,
 
  I was wondering the best way to tackle the following problem:
 
  I've got a class, containing a property which is another object. So
  from
  outside I should be able to do
  $firstobject-propertycontainingobject-methodinsidethatobject();
 
  The $firstobject variable is in the global namespace (having been made
  with
  $firstobject = new FirstObject;), and I'm having a problem that I'm
  sure
  many people have when accessing it inside another class, so:
 
  class otherObject
  {
  static function messwithotherthings ()
  {
  $firstobject-propertycontainingobject-methodinsidethatobject();
  }
  }
 
  But $firstobject is blank, which makes sense because in there it is
  pointing
  to the local variable within the method.
 
  To solve this, I could add 'global $firstobject' inside every method,
  but
  this is very redundant and boring. I've tried a couple of things like
  adding:
 
  private $firstobject = $GLOBALS['firstobject'];
 
  But apparently that's bad syntax. I was just wondering the best way to
  get
  around this?
 
  Thanks a lot for your help,
 
 
 
  Set the value of $firstobject in the constructor of otherObject (that's
  what
  constructors are for!):
 
  eg.
 
  class otherObject
  {
     private $firstobject;
 
     function __construct()
     {
         $this-firstobject = $GLOBALS['firstobject'];
     }
 
     static function messwithotherthings ()
     {
 
   $this-firstobject-propertycontainingobject-methodinsidethatobject();
     }
  }
 
 
  --
  Peter Ford                              phone: 01580 89
  Developer                               fax:   01580 893399
  Justcroft International Ltd., Staplehurst, Kent
 
  --
  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


 Thanks for the replies :)

 Surely if I pass it as a parameter to the __construct then I would have to
 make an instance of the otherObject, notice that messwithotherthings is
 static?

 Also, if I'm not using OOP properly, Eddie, how would I use it properly to
 prevent this situation?

 Thanks,

 --
 Luke Slater
 :O)



Well all you'd really need to do is something like this (for an instance class):

class ExampleClassYay {
private $instance;

public function __construct(someOtherClass $instance) {
$this-instance = $instance;
}

public function foo() {
var_dumP($this-instance);
}

}

So, all you'd have to do is something like:
$foo = new someOtherClass();
$example = new ExampleClassYay($foo);
$example-foo();

Whereas, for a static class, you can use a static property accessed
via self::$property instead of $this-property, like so:

Well all you'd really need to do is something like this:


class StaticExampleClassYay {
private static $instance;

static public function setInstance(someOtherClass $instance) {
self::$instance = $instance;
}

static public function foo() {
var_dump(self::$instance);
}

}

In which case, it'd be something like
$foo = new someOtherClass();
StaticExampleClassYay::setInstance($foo);
StaticExampleClassYay::foo();


What I meant, and I probably sounded a bit rougher than I absolutely
had to, was that it's pretty universally lazy and/or bad design to use
global variables inside a class, because classes have member
properties.  From a purely philosophical standpoint, classes are
supposed to be entirely self-contained and any data that a method
needs to process is supposed to be passed as a parameter, or exist
inside the class as a property.  It helps to think of classes like
cars on a highway; if you want it to go faster, you give it some gas
(pass a method a parameter), but if you want to turn on some music
while driving, the CDs should already exist in the car (accessing a
member property) even though they might have been added earlier (via a
different method with other parameters).  That's probably not the
greatest metaphor, but I hope you see what I'm saying.

--Eddie

PS. sorry for sounding rough :)

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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 11:12 AM, Peter Fordp...@justcroft.com wrote:
 Luke wrote:

 Thanks for the replies :)

 Surely if I pass it as a parameter to the __construct then I would have to
 make an instance of the otherObject, notice that messwithotherthings is
 static?

 Also, if I'm not using OOP properly, Eddie, how would I use it properly to
 prevent this situation?

 Thanks,


 Hmmm, I didn't notice the method was static - that means my idea really won't
 work...

 I did have a bad feeling about this, and Eddie confirmed my unease with the
 point about OOP.

 Really, you should need your $firstobject to be a singleton:
 eg.

 class FirstObject
 {
    private static $theInstance = NULL;

    public $propertyContainingObject;

    protected function __construct()
    {
        // whatever
    }

    public static function getInstance()
    {
        if (!self::$theInstance)
        {
            self::$theInstance = new FirstObject();
        }
        return self::$theInstance;
    }

    // ... other methods ...
 }


 So then:

 class OtherObject
 {
    static function messWithOtherThings()
    {
        $firstObject = FirstObject::getInstance();
        $firstObject-propertyContainingObject-methodInsideThatObject();
    }
 }



 I think that works, and is reasonable to the OOP purists...


 --
 Peter Ford                              phone: 01580 89
 Developer                               fax:   01580 893399
 Justcroft International Ltd., Staplehurst, Kent

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



I wouldn't really recommend going with a singleton in this situation,
as there exists a different solution (my other post :P) and there are
very few actual use-cases where the pattern makes sense, and deploying
it unnecessarily can cause a whole lot of headache D:

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



Re: [PHP] Compare and inserting with php

2009-06-30 Thread Bastien Koert
On Tue, Jun 30, 2009 at 11:17 AM, Ashley
Sheridana...@ashleysheridan.co.uk wrote:
 On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote:
 Okay, what I am trying to do is this:

 I have a db full of inspections, daily I need to run a script that will
 grab the posting of inspections, check them against the db to make sure
 they aren't duplicates and then insert all the new entries. Not sure if
 my logic of going about it this way is right, or if I'm off track and need
 to be doing something different please advise...so far this is how I am
 writing it.and it seems redundant ... Shouldn't there be a way to say
 (in plain speak) if there are no records with the name== insert this one,
 if there is one with the name then check intype if none ..insert... Etc


  if (!empty($Go)) {

 $query = SELECT * FROM restaurants WHERE name LIKE '$ucName';

  $result = mysql_query ($query);

  $row = mysql_fetch_object ($result);


  If (mysql_num_rows($result) == 0) {

 $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

 $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType', '$notes',
 '$critical', '$cleanViolations', '$noncritical');

         $result = mysql_query($sql) or die(mysql_error());


     } else {

  $query = SELECT * FROM restaurants WHERE inType LIKE '$inType' AND name
 LIKE '$ucName' ;

   $result = mysql_query ($query);

             $row = mysql_fetch_object ($result);

     If (mysql_num_rows($result) == 0) {

    $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

              $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');

         $result = mysql_query($sql) or die(mysql_error());


         } else {

   $query = SELECT * FROM restaurants WHERE inDate LIKE '$inDate' AND name
 LIKE '$ucName' ;

                $result = mysql_query ($query);

                $row = mysql_fetch_object ($result);


   If (mysql_num_rows($result) == 0) {

   $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

                $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');


        $result = mysql_query($sql) or die(mysql_error());


    }
 }

 It's a bad way of doing it, but could you not create a unique index on the
 particular key you want to be unique, and then just try the select anyway
 with the mysql_query() call preceeded with an @ to suppress warnings?

 Thanks,
 Ash

 http://www.ashleysheridan.co.uk

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



Does this list of inspections exist in the db? Could you not use an
INSERT INTO SELECT * FROM TABLE WHERE type statement...much less
processing overhead then

-- 

Bastien

Cat, the other other white meat

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



[PHP] Re: [PHP-DEV] Re: [PHP] PHP 5.3.0alpha2

2009-06-30 Thread Evert | Filemobile


On 4-Sep-08, at 12:06 AM, Andi Gutmans wrote:


Btw, contrary to what many believe, 32bit PHP tends to perform better
than 64bit PHP.
So unless there's a really good reason why you want 64bit I wouldn't
waste too much time on that.



I have heard this before, but CPU hasn't really been our bottleneck on  
our webservers, rather than memory.


Am I doing it wrong, or is that a 'really good reason' ?

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



Re: [PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion



On 6/30/09 10:40 AM, Bastien Koert phps...@gmail.com wrote:

On Tue, Jun 30, 2009 at 11:17 AM, Ashley
Sheridana...@ashleysheridan.co.uk wrote:
 On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote:
 Okay, what I am trying to do is this:

 I have a db full of inspections, daily I need to run a script that will
 grab the posting of inspections, check them against the db to make sure
 they aren't duplicates and then insert all the new entries. Not sure if
 my logic of going about it this way is right, or if I'm off track and need
 to be doing something different please advise...so far this is how I am
 writing it.and it seems redundant ... Shouldn't there be a way to say
 (in plain speak) if there are no records with the name== insert this one,
 if there is one with the name then check intype if none ..insert... Etc


  if (!empty($Go)) {

 $query = SELECT * FROM restaurants WHERE name LIKE '$ucName';

  $result = mysql_query ($query);

  $row = mysql_fetch_object ($result);


  If (mysql_num_rows($result) == 0) {

 $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

 $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType', '$notes',
 '$critical', '$cleanViolations', '$noncritical');

 $result = mysql_query($sql) or die(mysql_error());


 } else {

  $query = SELECT * FROM restaurants WHERE inType LIKE '$inType' AND name
 LIKE '$ucName' ;

   $result = mysql_query ($query);

 $row = mysql_fetch_object ($result);

 If (mysql_num_rows($result) == 0) {

$sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

  $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');

 $result = mysql_query($sql) or die(mysql_error());


 } else {

   $query = SELECT * FROM restaurants WHERE inDate LIKE '$inDate' AND name
 LIKE '$ucName' ;

$result = mysql_query ($query);

$row = mysql_fetch_object ($result);


   If (mysql_num_rows($result) == 0) {

   $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

$sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');


$result = mysql_query($sql) or die(mysql_error());


}
 }

 It's a bad way of doing it, but could you not create a unique index on the
 particular key you want to be unique, and then just try the select anyway
 with the mysql_query() call preceeded with an @ to suppress warnings?

 Thanks,
 Ash

 http://www.ashleysheridan.co.uk

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



Does this list of inspections exist in the db? Could you not use an
INSERT INTO SELECT * FROM TABLE WHERE type statement...much less
processing overhead then

--

Bastien

Cat, the other other white meat

Hi Bastien,

Something like this is what you mean?

 if (!empty($Go)) {$query = SELECT * FROM restaurants WHERE name = 
'$ucName' AND address = '$ucAddress' AND inDate ='$inDate' AND inType = 
'$inType' ;$result = mysql_query ($query);$row = mysql_fetch_object 
($result);If (mysql_num_rows($result) == 0) { $sql = INSERT INTO 
`restaurants` (name, address, inDate, inType, notes, critical, cviolations, 
noncritical)  VALUES (;$sql .=  '$ucName', '$ucAddress', '$inDate', 
'$inType', '$notes', '$critical', '$cleanViolations', '$noncritical');
$result = mysql_query($sql) or die(mysql_error());}So if all three 
things are met, that entry is in there if not insert right?

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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 11:17:17AM -0400, Eddie Drapkin wrote:

snip

 
 I wouldn't really recommend going with a singleton in this situation,
 as there exists a different solution (my other post :P) and there are
 very few actual use-cases where the pattern makes sense, and deploying
 it unnecessarily can cause a whole lot of headache D:
 

I disagree. A singleton is quite a good solution, particularly when you
only want one instance of an object. You can also create a registry
class which contains instances of objects which might be useful to other
classes.

Why would a singleton lead to headaches?

Paul
-- 
Paul M. Foster

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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 12:37 PM, Paul M Fosterpa...@quillandmouse.com wrote:
 On Tue, Jun 30, 2009 at 11:17:17AM -0400, Eddie Drapkin wrote:

 snip


 I wouldn't really recommend going with a singleton in this situation,
 as there exists a different solution (my other post :P) and there are
 very few actual use-cases where the pattern makes sense, and deploying
 it unnecessarily can cause a whole lot of headache D:


 I disagree. A singleton is quite a good solution, particularly when you
 only want one instance of an object. You can also create a registry
 class which contains instances of objects which might be useful to other
 classes.

 Why would a singleton lead to headaches?

 Paul
 --
 Paul M. Foster

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



If you only want one instance of a class at any point, that's the
whole purpose of the pattern, so how could I argue against that?  All
I said was it's really rare that there's a justifiable reason (and in
the above example, it's simply to compensate for not wanting to handle
it elsewhere i.e. laziness) to actually use the pattern.  A lot of the
times you see singletons in use, it's for ease of use, not
functionality; database layers, for example, have no necessity of
being singletons and it's restrictive to do so, yet it's done all the
time.  For a generic question like this, suggesting a single design
pattern as the solution is a bad idea, as someone who doesn't know
better will assume it's the only solution, thus leading to those
headaches of dealing with a misapplied paradigm to a particular
situation.

As far as the registry class paradigm goes, it's occasionally useful,
as is the singleton pattern, but it's not a solution I'd necessarily
recommend because of the overhead implications, especially not in such
a simple situation as storing an instance in a static variable.

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



Re: [PHP] Compare and inserting with php

2009-06-30 Thread Bastien Koert
On Tue, Jun 30, 2009 at 12:09 PM, Miller,
Teriontmil...@springfi.gannett.com wrote:



 On 6/30/09 10:40 AM, Bastien Koert phps...@gmail.com wrote:

 On Tue, Jun 30, 2009 at 11:17 AM, Ashley
 Sheridana...@ashleysheridan.co.uk wrote:
 On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote:
 Okay, what I am trying to do is this:

 I have a db full of inspections, daily I need to run a script that will
 grab the posting of inspections, check them against the db to make sure
 they aren't duplicates and then insert all the new entries. Not sure if
 my logic of going about it this way is right, or if I'm off track and need
 to be doing something different please advise...so far this is how I am
 writing it.and it seems redundant ... Shouldn't there be a way to say
 (in plain speak) if there are no records with the name== insert this one,
 if there is one with the name then check intype if none ..insert... Etc


  if (!empty($Go)) {

 $query = SELECT * FROM restaurants WHERE name LIKE '$ucName';

  $result = mysql_query ($query);

  $row = mysql_fetch_object ($result);


  If (mysql_num_rows($result) == 0) {

 $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

 $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType', '$notes',
 '$critical', '$cleanViolations', '$noncritical');

         $result = mysql_query($sql) or die(mysql_error());


     } else {

  $query = SELECT * FROM restaurants WHERE inType LIKE '$inType' AND name
 LIKE '$ucName' ;

   $result = mysql_query ($query);

             $row = mysql_fetch_object ($result);

     If (mysql_num_rows($result) == 0) {

    $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

              $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');

         $result = mysql_query($sql) or die(mysql_error());


         } else {

   $query = SELECT * FROM restaurants WHERE inDate LIKE '$inDate' AND name
 LIKE '$ucName' ;

                $result = mysql_query ($query);

                $row = mysql_fetch_object ($result);


   If (mysql_num_rows($result) == 0) {

   $sql = INSERT INTO `restaurants` (name, address, inDate, inType, notes,
 critical, cviolations, noncritical)  VALUES (;

                $sql .=  '$ucName', '$ucAddress', '$inDate', '$inType',
 '$notes', '$critical', '$cleanViolations', '$noncritical');


        $result = mysql_query($sql) or die(mysql_error());


    }
 }

 It's a bad way of doing it, but could you not create a unique index on the
 particular key you want to be unique, and then just try the select anyway
 with the mysql_query() call preceeded with an @ to suppress warnings?

 Thanks,
 Ash

 http://www.ashleysheridan.co.uk

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



 Does this list of inspections exist in the db? Could you not use an
 INSERT INTO SELECT * FROM TABLE WHERE type statement...much less
 processing overhead then

 --

 Bastien

 Cat, the other other white meat

 Hi Bastien,

 Something like this is what you mean?

  if (!empty($Go)) {    $query = SELECT * FROM restaurants WHERE name = 
 '$ucName' AND address = '$ucAddress' AND inDate ='$inDate' AND inType = 
 '$inType' ;    $result = mysql_query ($query);    $row = mysql_fetch_object 
 ($result);    If (mysql_num_rows($result) == 0) { $sql = INSERT INTO 
 `restaurants` (name, address, inDate, inType, notes, critical, cviolations, 
 noncritical)  VALUES (;    $sql .=  '$ucName', '$ucAddress', '$inDate', 
 '$inType', '$notes', '$critical', '$cleanViolations', '$noncritical');       
  $result = mysql_query($sql) or die(mysql_error());    }        So if all 
 three things are met, that entry is in there if not insert right?


More like

sql = insert into restaurants select * from restaurants where name =
'$ucName' AND address = '$ucAddress' AND inDate ='$inDate' AND inType
= '$inType' ;

http://dev.mysql.com/doc/refman/5.0/en/insert-select.html



-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion






 Does this list of inspections exist in the db? Could you not use an
 INSERT INTO SELECT * FROM TABLE WHERE type statement...much less
 processing overhead then

 --

 Bastien

 Cat, the other other white meat

 Hi Bastien,

 Something like this is what you mean?

  if (!empty($Go)) {$query = SELECT * FROM restaurants WHERE name = 
 '$ucName' AND address = '$ucAddress' AND inDate ='$inDate' AND inType = 
 '$inType' ;$result = mysql_query ($query);$row = mysql_fetch_object 
 ($result);If (mysql_num_rows($result) == 0) { $sql = INSERT INTO 
 `restaurants` (name, address, inDate, inType, notes, critical, cviolations, 
 noncritical)  VALUES (;$sql .=  '$ucName', '$ucAddress', '$inDate', 
 '$inType', '$notes', '$critical', '$cleanViolations', '$noncritical');   
  $result = mysql_query($sql) or die(mysql_error());}So if all 
 three things are met, that entry is in there if not insert right?


More like

sql = insert into restaurants select * from restaurants where name =
'$ucName' AND address = '$ucAddress' AND inDate ='$inDate' AND inType
= '$inType' ;

http://dev.mysql.com/doc/refman/5.0/en/insert-select.html



--

Bastien

Cat, the other other white meat


Well I didn't get anywhere, now I just keep getting this error


Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
resource in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/ResturantInspections/compare.php
 on line 119
You have an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near 's Roast Beef Restaurant 
#9459', ' 1833 W Republic Rd ', '3/2/09', '' at line 1

Using this code:

 $query = SELECT * FROM  restaurants  WHERE  name = '$ucName' AND address = 
'$ucAddress' AND inDate ='$inDate' AND inType = '$inType' ;$result = 
mysql_query ($query);   // $row = mysql_fetch_object ($result);echo 
$result;If (mysql_num_rows($result) == 0) {$sql = INSERT INTO 
`restaurants` (name, address, inDate, inType, notes, critical, cviolations, 
noncritical)  VALUES (;$sql .=  '$ucName', '$ucAddress', '$inDate', 
'$inType', '$notes', '$critical', '$cleanViolations', '$noncritical');
$result = mysql_query($sql) or die(mysql_error());}

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



Re: [PHP] Compare and inserting with php

2009-06-30 Thread Andrew Ballard
On Tue, Jun 30, 2009 at 2:19 PM, Miller,
Teriontmil...@springfi.gannett.com wrote:






 Does this list of inspections exist in the db? Could you not use an
 INSERT INTO SELECT * FROM TABLE WHERE type statement...much less
 processing overhead then

 --

 Bastien

 Cat, the other other white meat

 Hi Bastien,

 Something like this is what you mean?

  if (!empty($Go)) {    $query = SELECT * FROM restaurants WHERE name = 
 '$ucName' AND address = '$ucAddress' AND inDate ='$inDate' AND inType = 
 '$inType' ;    $result = mysql_query ($query);    $row = mysql_fetch_object 
 ($result);    If (mysql_num_rows($result) == 0) { $sql = INSERT INTO 
 `restaurants` (name, address, inDate, inType, notes, critical, cviolations, 
 noncritical)  VALUES (;    $sql .=  '$ucName', '$ucAddress', '$inDate', 
 '$inType', '$notes', '$critical', '$cleanViolations', '$noncritical');      
   $result = mysql_query($sql) or die(mysql_error());    }        So if all 
 three things are met, that entry is in there if not insert right?


 More like

 sql = insert into restaurants select * from restaurants where name =
 '$ucName' AND address = '$ucAddress' AND inDate ='$inDate' AND inType
 = '$inType' ;

 http://dev.mysql.com/doc/refman/5.0/en/insert-select.html



 --

 Bastien

 Cat, the other other white meat


 Well I didn't get anywhere, now I just keep getting this error


 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
 resource in 
 /var/www/vhosts/getpublished.news-leader.com/httpdocs/ResturantInspections/compare.php
  on line 119
 You have an error in your SQL syntax; check the manual that corresponds to 
 your MySQL server version for the right syntax to use near 's Roast Beef 
 Restaurant #9459', ' 1833 W Republic Rd ', '3/2/09', '' at line 1

 Using this code:

  $query = SELECT * FROM  restaurants  WHERE  name = '$ucName' AND address = 
 '$ucAddress' AND inDate ='$inDate' AND inType = '$inType' ;    $result = 
 mysql_query ($query);   // $row = mysql_fetch_object ($result);        echo 
 $result;    If (mysql_num_rows($result) == 0) {    $sql = INSERT INTO 
 `restaurants` (name, address, inDate, inType, notes, critical, cviolations, 
 noncritical)  VALUES (;    $sql .=  '$ucName', '$ucAddress', '$inDate', 
 '$inType', '$notes', '$critical', '$cleanViolations', '$noncritical');       
  $result = mysql_query($sql) or die(mysql_error());    }

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



For one thing, that error message shows that you are not properly
escaping the strings you are sending to mysql_query() (specifically,
$ucName in this case). Even if you do get it to work, you'll be
vulnerable to SQL injection.

Andrew

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



Re: [PHP] Compare and inserting with php

2009-06-30 Thread Tom Worster
On 6/30/09 11:17 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote:

 It's a bad way of doing it, but could you not create a unique index on the
 particular key you want to be unique, and then just try the select anyway
 with the mysql_query() call preceeded with an @ to suppress warnings?

if you're going that route and your DB supports it, use INSERT IGNORE.

if the primary/unique key makes sense for the application then i don't think
this is all that bad a way of doing things.



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



Re: [PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion



On 6/30/09 1:31 PM, Tom Worster f...@thefsb.org wrote:

On 6/30/09 11:17 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote:

 It's a bad way of doing it, but could you not create a unique index on the
 particular key you want to be unique, and then just try the select anyway
 with the mysql_query() call preceeded with an @ to suppress warnings?

if you're going that route and your DB supports it, use INSERT IGNORE.

if the primary/unique key makes sense for the application then i don't think
this is all that bad a way of doing things.




This is the error:

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result 
resource in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/ResturantInspections/compare.php
 on line 114

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
resource in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/ResturantInspections/compare.php
 on line 118
You have an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near 's Roast Beef Restaurant 
#9459', ' 1833 W Republic Rd ', '3/2/09', '' at line 1

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



Re: [PHP] Best way to reinstate radio-button states from database?

2009-06-30 Thread Tom Worster
On 6/29/09 10:26 PM, Michael A. Peters mpet...@mac.com wrote:

 Rob Gould wrote:
 I have a webpage which allows people to log in and make selections with
 radio buttons and hit SUBMIT and saves the data from those radio buttons
 to a mySQL database.
 
 However, I'm finding that I also need the ability to allow a user to log
 back in at a later date (or even on a different computer), and pull up
 that survey again,
 with each of the 50-something radio-buttons back in the positions in
 which they were last saved.
 
 Surely there's a best-case-method for doing this type of thing (saving
 large numbers of radio-button-group settings to mySQL and pulling them back
 again later).  Any advice is greatly appreciated.  Perhaps there's a
 jQuery-way to retrieve all the radio-button group settings as an array
 and save it and pull it back again?
 Or perhaps a PHP-specific method - - - I'm fine with either.
 
 
 Generate your radio list via php.
 When the value grabbed from database matches the button value, add a
 selected=selected to the radio input.
 
 Works for me.

michael: radios and checkboxes take the checked attribute -- options in
selects take the selected attribute.
http://www.w3.org/TR/html401/interact/forms.html#checkbox

rob: if you use systematic naming of the radio input elements (e.g. a common
prefix) then you can use a simple loop to generate an SQL query from the
$_POST array to store the form state as a string. then use another loop to
generate the markup for all your radios, inserting the checked attribute for
those radios whose names appear in the string you stored in the DB. the key
is the systematic naming and having a page design (and maybe template
scheme, if you like) that allows simple automated generation of the form's
markup. 



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



[PHP] exasperated again

2009-06-30 Thread PJ
Could somebody please explain to me what is wrong with this code?
In my script it works, returns the correct id, but when I try it in a
test pages, nothing in the world gets it to work. This is rather
frustrating, again:
THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT.
$sql = SELECT id FROM publishers
WHERE publisher = 'whoever';
  $result = mysql_query($sql,$db);
$row = mysql_fetch_assoc($result); 
  if (mysql_num_rows($result) !== 0) {
  $pub = $row['id'];
Syntax is ok, echo hello; works.


This works in the test page:
$aid = array();
$ord = array();
$sql = SELECT authID, ordinal
FROM book_author WHERE bookid = 624 ORDER BY ordinal ASC;
$result = mysql_query($sql, $db); 
//$row = mysql_fetch_assoc($result);
while ( $row = mysql_fetch_assoc($result) ) {
$aid[]=$row['authID'];
$ord[]=$row['ordinal'];
}
var_dump($aid);
echo br /;
var_dump($ord);
echo $aid[0],  - ;
echo $ord[0];

This does not:
$fi=joe; $la=joe;
$sql = SELECT id FROM author
WHERE first_name = '$fi'  last_name = '$la';
$result = msql_query($sql, $db);
$row = mysql_fetch_assoc($result);
$count=mysql_num_rows($result);
echo $count;
  if (mysql_num_rows($result)  0) {
  $a_id=$row['id'];
  }
  echo $a_id, br /br /;
The test page prints out echo some text; but no results when the
results are there
Tell me I have missed something simple here, or is this normal for php ?
I have checked the queries on Mysql command line and they are fine.
I have verified the syntax and Netbeans tells me it is fine.
Same results Firefox3 (2 machines)  IE 8.
What is not fine?

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


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



Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread PJ
PJ wrote:
 Could somebody please explain to me what is wrong with this code?
 In my script it works, returns the correct id, but when I try it in a
 test pages, nothing in the world gets it to work. This is rather
 frustrating, again:
 THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT.
 $sql = SELECT id FROM publishers
 WHERE publisher = 'whoever';
   $result = mysql_query($sql,$db);
 $row = mysql_fetch_assoc($result); 
   if (mysql_num_rows($result) !== 0) {
   $pub = $row['id'];
 Syntax is ok, echo hello; works.


 This works in the test page:
 $aid = array();
 $ord = array();
 $sql = SELECT authID, ordinal
 FROM book_author WHERE bookid = 624 ORDER BY ordinal ASC;
 $result = mysql_query($sql, $db); 
 //$row = mysql_fetch_assoc($result);
 while ( $row = mysql_fetch_assoc($result) ) {
 $aid[]=$row['authID'];
 $ord[]=$row['ordinal'];
 }
 var_dump($aid);
 echo br /;
 var_dump($ord);
 echo $aid[0],  - ;
 echo $ord[0];

 This does not:
 $fi=joe; $la=joe;
 $sql = SELECT id FROM author
 WHERE first_name = '$fi'  last_name = '$la';
 $result = msql_query($sql, $db);
 $row = mysql_fetch_assoc($result);
 $count=mysql_num_rows($result);
 echo $count;
   if (mysql_num_rows($result)  0) {
   $a_id=$row['id'];
   }
   echo $a_id, br /br /;
 The test page prints out echo some text; but no results when the
 results are there
 Tell me I have missed something simple here, or is this normal for php ?
 I have checked the queries on Mysql command line and they are fine.
 I have verified the syntax and Netbeans tells me it is fine.
 Same results Firefox3 (2 machines)  IE 8.
 What is not fine?

   
Damn, it's frustrating to find that there is a difference between msql
and mysql... ouch, the foot hurts now!

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


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



Re: [PHP] exasperated again

2009-06-30 Thread Andrew Ballard
On Tue, Jun 30, 2009 at 4:01 PM, PJaf.gour...@videotron.ca wrote:
 Could somebody please explain to me what is wrong with this code?
 In my script it works, returns the correct id, but when I try it in a
 test pages, nothing in the world gets it to work. This is rather
 frustrating, again:
 THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT.
 $sql = SELECT id FROM publishers
        WHERE publisher = 'whoever';
      $result = mysql_query($sql,$db);
        $row = mysql_fetch_assoc($result);
          if (mysql_num_rows($result) !== 0) {
          $pub = $row['id'];
 Syntax is ok, echo hello; works.


 This works in the test page:
 $aid = array();
 $ord = array();
 $sql = SELECT authID, ordinal
        FROM book_author WHERE bookid = 624 ORDER BY ordinal ASC;
        $result = mysql_query($sql, $db);
            //$row = mysql_fetch_assoc($result);
            while ( $row = mysql_fetch_assoc($result) ) {
            $aid[]=$row['authID'];
            $ord[]=$row['ordinal'];
            }
            var_dump($aid);
            echo br /;
            var_dump($ord);
            echo $aid[0],  - ;
            echo $ord[0];

 This does not:
 $fi=joe; $la=joe;
 $sql = SELECT id FROM author
        WHERE first_name = '$fi'  last_name = '$la';
    $result = msql_query($sql, $db);
        $row = mysql_fetch_assoc($result);
        $count=mysql_num_rows($result);
    echo $count;
          if (mysql_num_rows($result)  0) {
          $a_id=$row['id'];
          }
          echo $a_id, br /br /;
 The test page prints out echo some text; but no results when the
 results are there
 Tell me I have missed something simple here, or is this normal for php ?
 I have checked the queries on Mysql command line and they are fine.
 I have verified the syntax and Netbeans tells me it is fine.
 Same results Firefox3 (2 machines)  IE 8.
 What is not fine?

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


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



I see a typo in the last block where you call $result =
msql_query(...) instead of $result = mysql_query(...). Is that in your
actual code?

Andrew

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



Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread Bastien Koert
On Tue, Jun 30, 2009 at 4:48 PM, PJaf.gour...@videotron.ca wrote:
 PJ wrote:
 Could somebody please explain to me what is wrong with this code?
 In my script it works, returns the correct id, but when I try it in a
 test pages, nothing in the world gets it to work. This is rather
 frustrating, again:
 THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT.
 $sql = SELECT id FROM publishers
         WHERE publisher = 'whoever';
       $result = mysql_query($sql,$db);
         $row = mysql_fetch_assoc($result);
           if (mysql_num_rows($result) !== 0) {
           $pub = $row['id'];
 Syntax is ok, echo hello; works.


 This works in the test page:
 $aid = array();
 $ord = array();
 $sql = SELECT authID, ordinal
         FROM book_author WHERE bookid = 624 ORDER BY ordinal ASC;
         $result = mysql_query($sql, $db);
             //$row = mysql_fetch_assoc($result);
             while ( $row = mysql_fetch_assoc($result) ) {
             $aid[]=$row['authID'];
             $ord[]=$row['ordinal'];
             }
             var_dump($aid);
             echo br /;
             var_dump($ord);
             echo $aid[0],  - ;
             echo $ord[0];

 This does not:
 $fi=joe; $la=joe;
 $sql = SELECT id FROM author
         WHERE first_name = '$fi'  last_name = '$la';
     $result = msql_query($sql, $db);
         $row = mysql_fetch_assoc($result);
         $count=mysql_num_rows($result);
     echo $count;
           if (mysql_num_rows($result)  0) {
           $a_id=$row['id'];
           }
           echo $a_id, br /br /;
 The test page prints out echo some text; but no results when the
 results are there
 Tell me I have missed something simple here, or is this normal for php ?
 I have checked the queries on Mysql command line and they are fine.
 I have verified the syntax and Netbeans tells me it is fine.
 Same results Firefox3 (2 machines)  IE 8.
 What is not fine?


 Damn, it's frustrating to find that there is a difference between msql
 and mysql... ouch, the foot hurts now!

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


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



Blame the native, libraries that is

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 4:50 PM, Bastien Koertphps...@gmail.com wrote:
 On Tue, Jun 30, 2009 at 4:48 PM, PJaf.gour...@videotron.ca wrote:
 PJ wrote:
 Could somebody please explain to me what is wrong with this code?
 In my script it works, returns the correct id, but when I try it in a
 test pages, nothing in the world gets it to work. This is rather
 frustrating, again:
 THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT.
 $sql = SELECT id FROM publishers
         WHERE publisher = 'whoever';
       $result = mysql_query($sql,$db);
         $row = mysql_fetch_assoc($result);
           if (mysql_num_rows($result) !== 0) {
           $pub = $row['id'];
 Syntax is ok, echo hello; works.


 This works in the test page:
 $aid = array();
 $ord = array();
 $sql = SELECT authID, ordinal
         FROM book_author WHERE bookid = 624 ORDER BY ordinal ASC;
         $result = mysql_query($sql, $db);
             //$row = mysql_fetch_assoc($result);
             while ( $row = mysql_fetch_assoc($result) ) {
             $aid[]=$row['authID'];
             $ord[]=$row['ordinal'];
             }
             var_dump($aid);
             echo br /;
             var_dump($ord);
             echo $aid[0],  - ;
             echo $ord[0];

 This does not:
 $fi=joe; $la=joe;
 $sql = SELECT id FROM author
         WHERE first_name = '$fi'  last_name = '$la';
     $result = msql_query($sql, $db);
         $row = mysql_fetch_assoc($result);
         $count=mysql_num_rows($result);
     echo $count;
           if (mysql_num_rows($result)  0) {
           $a_id=$row['id'];
           }
           echo $a_id, br /br /;
 The test page prints out echo some text; but no results when the
 results are there
 Tell me I have missed something simple here, or is this normal for php ?
 I have checked the queries on Mysql command line and they are fine.
 I have verified the syntax and Netbeans tells me it is fine.
 Same results Firefox3 (2 machines)  IE 8.
 What is not fine?


 Damn, it's frustrating to find that there is a difference between msql
 and mysql... ouch, the foot hurts now!

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


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



 Blame the native, libraries that is

 --

 Bastien

 Cat, the other other white meat

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



Take it as a sign you shouldn't be using mysql_ at all :)

Use the OOP interface to mysqli or PDO and these problems don't happen

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



RE: [PHP] exasperated again - shot in the foot

2009-06-30 Thread Jay Blanchard
[snip]
Use the OOP interface to mysqli or PDO and these problems don't happen
[/snip]

Either that or include a modicum of error checking in your code. 

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



Re: [PHP] Re: Scope woe

2009-06-30 Thread Shawn McKenzie
Eddie Drapkin wrote:
 On Tue, Jun 30, 2009 at 10:44 AM, Lukel...@blog-thing.com wrote:
 
 What I meant, and I probably sounded a bit rougher than I absolutely
 had to, was that it's pretty universally lazy and/or bad design to use
 global variables inside a class, because classes have member
 properties.  From a purely philosophical standpoint, classes are
 supposed to be entirely self-contained and any data that a method
 needs to process is supposed to be passed as a parameter, or exist
 inside the class as a property.  It helps to think of classes like
 cars on a highway; if you want it to go faster, you give it some gas
 (pass a method a parameter), but if you want to turn on some music
 while driving, the CDs should already exist in the car (accessing a
 member property) even though they might have been added earlier (via a
 different method with other parameters).  That's probably not the
 greatest metaphor, but I hope you see what I'm saying.


You are correct as there was no metaphor in here at all!  This, It
helps to think of classes like cars on a highway, is almost a simile,
but on the whole I would probably say that you were using an analogy :-)


-- 
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] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
 You are correct as there was no metaphor in here at all!  This, It
 helps to think of classes like cars on a highway, is almost a simile,
 but on the whole I would probably say that you were using an analogy :-)


HEIL SPELLCHECK!

I bow to my grammar nazi superior *bow*

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



[PHP] check a variable after EACH function

2009-06-30 Thread Flint Million
This might seem silly but here's what I'm trying to do

Suppose I have some kind of check variable - say for example
$abort_now. Or it could be a function. Something to be evaluated to a
value.

I want to execute a block of statements, but after EACH statement
executes, check the value of $abort_now and if it is true, break; out
of the block.

Here's an example

do {
  do_something();
  do_something_else();
  do_another_thing();
  do_yet_another_thing();
  and_keep_doing_things();
} while ($abort_now != 1);

What I want to happen is for each statement to execute, and keep
looping around, until the $abort_now variable is set to 1. Now,
suppose any one of the statements in that block may cause $abort_now
to become 1. If that happens, I want the block to stop executing
immediately and not continue executing further statements.

For example, do_another_thing() causes $abort_now to equal 1. I do not
want do_yet_another_thing or keep doing things to execute. I want the
loop to stop right there.

The only way I can think of doing it is to insert a check after each statement:

do {
  do_something();
  if ($abort_now == 1) { break; }
  do_something_else();
  if ($abort_now == 1) { break; }
  do_another_thing();
  if ($abort_now == 1) { break; }
  do_yet_another_thing();
  if ($abort_now == 1) { break; }
  and_keep_doing_things();
  if ($abort_now == 1) { break; }
} while (TRUE);

This might work for 2 or 3 statements but imagine a block of say 15
statements. Having a check after each one would look ugly, and cause
trouble if the condition needed to be changed or if I instead decided
to check it, say, against a function.

So is this possible to do with built in code? or am I stuck with
having to put a check after each statement in?

thanks

fm

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



[PHP] Re: check a variable after EACH function

2009-06-30 Thread Shawn McKenzie
Flint Million wrote:
 This might seem silly but here's what I'm trying to do
 
 Suppose I have some kind of check variable - say for example
 $abort_now. Or it could be a function. Something to be evaluated to a
 value.
 
 I want to execute a block of statements, but after EACH statement
 executes, check the value of $abort_now and if it is true, break; out
 of the block.
 
 Here's an example
 
 do {
   do_something();
   do_something_else();
   do_another_thing();
   do_yet_another_thing();
   and_keep_doing_things();
 } while ($abort_now != 1);
 
 What I want to happen is for each statement to execute, and keep
 looping around, until the $abort_now variable is set to 1. Now,
 suppose any one of the statements in that block may cause $abort_now
 to become 1. If that happens, I want the block to stop executing
 immediately and not continue executing further statements.
 
 For example, do_another_thing() causes $abort_now to equal 1. I do not
 want do_yet_another_thing or keep doing things to execute. I want the
 loop to stop right there.
 
 The only way I can think of doing it is to insert a check after each 
 statement:
 
 do {
   do_something();
   if ($abort_now == 1) { break; }
   do_something_else();
   if ($abort_now == 1) { break; }
   do_another_thing();
   if ($abort_now == 1) { break; }
   do_yet_another_thing();
   if ($abort_now == 1) { break; }
   and_keep_doing_things();
   if ($abort_now == 1) { break; }
 } while (TRUE);
 
 This might work for 2 or 3 statements but imagine a block of say 15
 statements. Having a check after each one would look ugly, and cause
 trouble if the condition needed to be changed or if I instead decided
 to check it, say, against a function.
 
 So is this possible to do with built in code? or am I stuck with
 having to put a check after each statement in?
 
 thanks
 
 fm

Well, since the functions can set $abort_now, why can't they just abort?
Or throw an exception?

try {
do {
do_something();
do_something_else();
do_another_thing();
do_yet_another_thing();
and_keep_doing_things();
} while (true);
} catch (Exception $e) {
//do something or nothing
}

Then in your functions instead of setting $abort_now, do:

throw new Exception('Abort! Abort! Abort!');


-- 
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] Best way to reinstate radio-button states from database?

2009-06-30 Thread Michael A. Peters

Tom Worster wrote:
*snip*


michael: radios and checkboxes take the checked attribute -- options in
selects take the selected attribute.


Doh - I knew that.
Typo. I always thought it silly there were two different attributes 
anyway, when they basically are same thing and can never both occur in 
same tag.


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



Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread PJ
Jay Blanchard wrote:
 [snip]
 Use the OOP interface to mysqli or PDO and these problems don't happen
 [/snip]

 Either that or include a modicum of error checking in your code. 

   
OK, Ok, I feel stupid enough already.
I'm not sure I want to get in that deep... it's tough enough with the
simple stuff...
so, talk to me about the OOP interface or the PDO... :-\

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


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



[PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Mary Anderson

Hi all,

  I have a php application for which I have a page which creates 
temporary junk and puts it into a persistent store  (in this case a 
postgres database, but that is beside the point.)


  I have a Save button which puts the stuff I really want into the 
persistent store and cleans up the temporary junk.  I have a Cancel 
button which only cleans up the temporary junk.


   I would really like to have the cleanup code run anytime a user 
leaves the page without hitting the Save button.  Is there anyway to do 
this?  I.e. have php code called conditionally on exiting the page?


Thanks
Mary

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



Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Michael A. Peters

Mary Anderson wrote:

Hi all,

  I have a php application for which I have a page which creates 
temporary junk and puts it into a persistent store  (in this case a 
postgres database, but that is beside the point.)


  I have a Save button which puts the stuff I really want into the 
persistent store and cleans up the temporary junk.  I have a Cancel 
button which only cleans up the temporary junk.


   I would really like to have the cleanup code run anytime a user 
leaves the page without hitting the Save button.  Is there anyway to do 
this?  I.e. have php code called conditionally on exiting the page?


Thanks
Mary



I do a similar thing and put a unix timestamp on the temporary database.
A cron job run once a day calls a page that deletes anything in the 
temporary database that has a timestamp  24 hours old.


You don't have to do it with a cron job - you can also have the function 
that writes to the table delete anything older than X hours if you don't 
have facilities to cron (though you can run the cron job from any 
machine, doesn't need to run on the server)


something like this

?php
require('dbconnect.inc.php');
$expire = time() - (24 * 60 * 60);
$sql = DELETE FROM temporary WHERE stamp  $expire;
mysql_query($sql);
?

The security of who can access it isn't important, as it only deletes 
what you no longer want anyway and it returns no data to the browser.


Write a shell script that fetches it via wget and have cron execute it 
daily.


Maybe there's a better way, but it works for me.

For temporary files on the filesystem, I use 
http://linux.about.com/library/cmd/blcmdl8_tmpwatch.htm


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



Re: [PHP] check a variable after EACH function

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 06:31:54PM -0500, Flint Million wrote:

 This might seem silly but here's what I'm trying to do
 
 Suppose I have some kind of check variable - say for example
 $abort_now. Or it could be a function. Something to be evaluated to a
 value.
 
 I want to execute a block of statements, but after EACH statement
 executes, check the value of $abort_now and if it is true, break; out
 of the block.
 
 Here's an example
 
 do {
   do_something();
   do_something_else();
   do_another_thing();
   do_yet_another_thing();
   and_keep_doing_things();
 } while ($abort_now != 1);
 
 What I want to happen is for each statement to execute, and keep
 looping around, until the $abort_now variable is set to 1. Now,
 suppose any one of the statements in that block may cause $abort_now
 to become 1. If that happens, I want the block to stop executing
 immediately and not continue executing further statements.
 
 For example, do_another_thing() causes $abort_now to equal 1. I do not
 want do_yet_another_thing or keep doing things to execute. I want the
 loop to stop right there.
 
 The only way I can think of doing it is to insert a check after each
 statement:
 
 do {
   do_something();
   if ($abort_now == 1) { break; }
   do_something_else();
   if ($abort_now == 1) { break; }
   do_another_thing();
   if ($abort_now == 1) { break; }
   do_yet_another_thing();
   if ($abort_now == 1) { break; }
   and_keep_doing_things();
   if ($abort_now == 1) { break; }
 } while (TRUE);
 
 This might work for 2 or 3 statements but imagine a block of say 15
 statements. Having a check after each one would look ugly, and cause
 trouble if the condition needed to be changed or if I instead decided
 to check it, say, against a function.
 
 So is this possible to do with built in code? or am I stuck with
 having to put a check after each statement in?

Aside from Shawn's exception method, you're relatively limited in how
you do this. All the other methods amount to essentially what you're
doing here. There's no other loop structure in PHP that will do it any
better than what you've devised.

FWIW, I've had to do this exact thing with regard to form validation,
except I'm not looping. Check each condition, and if it fails, never
mind validating the rest of the fields.

If you're concerned about the possibility of having to replace the
$abort_now variable with a function later, you have two choices. First,
use an editor which does search-and-replace efficiently. Second, set up
a function which is called wherever you have $abort_now currently. For
the moment, have that function simply check the $abort_now variable. In
the future, you could have it do something else, but not have to change
your existing code.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 06:38:19PM -0700, Mary Anderson wrote:

 Hi all,

   I have a php application for which I have a page which creates
 temporary junk and puts it into a persistent store  (in this case a
 postgres database, but that is beside the point.)

   I have a Save button which puts the stuff I really want into the
 persistent store and cleans up the temporary junk.  I have a Cancel
 button which only cleans up the temporary junk.

I would really like to have the cleanup code run anytime a user
 leaves the page without hitting the Save button.  Is there anyway to do
 this?  I.e. have php code called conditionally on exiting the page?

If the user hits the Back button or exits via clicking on some link on
the page, there's no reasonable way to do this (Michael's cron versions
excepted). Because the HTTP protocol has no effective memory, there's no
way for it to know that the user exited without saving. You can do
various tricky things like set a $_SESSION variable, and then have it
checked at the top of each page where the user could go, and check and
clean up if the variable has a certain value. But that's pretty tedious.
You could execute the whole thing as part of a class, and put a check in
the constructor of the class (where it will be called on every page)
which cleans up if necessary.

In other words, there are ways to do this, but they are tedious. The
PHP/HTTP execution engines have no way of doing it on their own.

(Oh, there may be a way to do this with Javascript. I'm not good with
Javascript, but maybe there's some OnExit event which you could use to
cause a Javascript function to do an AJAX call to a PHP script which
cleans up. I dunno.)

Paul

-- 
Paul M. Foster

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



Re: [PHP] Re: Push an Array, Comma separated.

2009-06-30 Thread Louie Miranda
This is what I did. And it worked.

$saveFiles = array();
$arrSize=sizeof($saveFiles);
for ($number = 0; $number  $arrSize; $number++) {
$saveFilesDump = $saveFiles[$number], ;
echo $saveFiles[$number], ;
}

File1.txt, File2.txt, File3.txt,

--
Louie Miranda (lmira...@gmail.com)
http://www.louiemiranda.net

Quality Web Hosting - www.axishift.com
Pinoy Web Hosting, Web Hosting Philippines


2009/6/30 João Cândido de Souza Neto j...@consultorweb.cnt.br

 May be array_merge($array, explode(,, $string)).

 --
 João Cândido de Souza Neto
 SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS
 Fone: (0XX41) 3033-3636 - JS
 www.siens.com.br

 Louie Miranda lmira...@gmail.com escreveu na mensagem
 news:5016fc50906300125s12389ae1v3323c63c30343...@mail.gmail.com...
  GPS Administrative Page v2.3.12 (BETA)My array:
  Array ( [0] = Demo2.txt [1] = Demo.txt [2] = Demo.txt )
 
  How could I push the values as:
 
  - Demo2.txt, Demo.txt, Demo.txt?
 
  Not sure which approach is good.
 
  $saveFiles = array();
  array_push($saveFiles, $ufName);
 
  Help
  --
  Louie Miranda (lmira...@gmail.com)
  http://www.louiemiranda.net
 
  Quality Web Hosting - www.axishift.com
  Pinoy Web Hosting, Web Hosting Philippines
 



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




Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread WenDong Zhang
yes, the browser evoke unload event when leave the page (back, forward, or
close). you can send a message via ajax, but it may not been received by the
server successful, (when close the browser)

I think the best way is maintaining a timestamp as michael  paul say, and
clear the 'junk' timely.

there is another way if you need to get some INFO when user leaves this page
(such as leave time...):
 save the INFO into cache
 set time interval do the follow:
  1. load INFO from cache
  2. send the INFO via ajax and wait the server confirm it has received the
INFO
  3. if the server response is ture, delete the INFO or send the INFO again
a while later
by this way, even users closed their browser, but the next time they open
your web page, they will send the cached INFO too.

On Wed, Jul 1, 2009 at 10:59 AM, Paul M Foster pa...@quillandmouse.comwrote:

 On Tue, Jun 30, 2009 at 06:38:19PM -0700, Mary Anderson wrote:

  Hi all,
 
I have a php application for which I have a page which creates
  temporary junk and puts it into a persistent store  (in this case a
  postgres database, but that is beside the point.)
 
I have a Save button which puts the stuff I really want into the
  persistent store and cleans up the temporary junk.  I have a Cancel
  button which only cleans up the temporary junk.
 
 I would really like to have the cleanup code run anytime a user
  leaves the page without hitting the Save button.  Is there anyway to do
  this?  I.e. have php code called conditionally on exiting the page?

 If the user hits the Back button or exits via clicking on some link on
 the page, there's no reasonable way to do this (Michael's cron versions
 excepted). Because the HTTP protocol has no effective memory, there's no
 way for it to know that the user exited without saving. You can do
 various tricky things like set a $_SESSION variable, and then have it
 checked at the top of each page where the user could go, and check and
 clean up if the variable has a certain value. But that's pretty tedious.
 You could execute the whole thing as part of a class, and put a check in
 the constructor of the class (where it will be called on every page)
 which cleans up if necessary.

 In other words, there are ways to do this, but they are tedious. The
 PHP/HTTP execution engines have no way of doing it on their own.

 (Oh, there may be a way to do this with Javascript. I'm not good with
 Javascript, but maybe there's some OnExit event which you could use to
 cause a Javascript function to do an AJAX call to a PHP script which
 cleans up. I dunno.)

 Paul

 --
 Paul M. Foster

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




-- 
Best Regards!
Wen Dong


Re: [PHP] check a variable after EACH function

2009-06-30 Thread Phpster





On Jun 30, 2009, at 10:48 PM, Paul M Foster pa...@quillandmouse.com  
wrote:



On Tue, Jun 30, 2009 at 06:31:54PM -0500, Flint Million wrote:


This might seem silly but here's what I'm trying to do

Suppose I have some kind of check variable - say for example
$abort_now. Or it could be a function. Something to be evaluated to a
value.

I want to execute a block of statements, but after EACH statement
executes, check the value of $abort_now and if it is true, break; out
of the block.

Here's an example

do {
 do_something();
 do_something_else();
 do_another_thing();
 do_yet_another_thing();
 and_keep_doing_things();
} while ($abort_now != 1);

What I want to happen is for each statement to execute, and keep
looping around, until the $abort_now variable is set to 1. Now,
suppose any one of the statements in that block may cause $abort_now
to become 1. If that happens, I want the block to stop executing
immediately and not continue executing further statements.

For example, do_another_thing() causes $abort_now to equal 1. I do  
not

want do_yet_another_thing or keep doing things to execute. I want the
loop to stop right there.

The only way I can think of doing it is to insert a check after each
statement:

do {
 do_something();
 if ($abort_now == 1) { break; }
 do_something_else();
 if ($abort_now == 1) { break; }
 do_another_thing();
 if ($abort_now == 1) { break; }
 do_yet_another_thing();
 if ($abort_now == 1) { break; }
 and_keep_doing_things();
 if ($abort_now == 1) { break; }
} while (TRUE);

This might work for 2 or 3 statements but imagine a block of say 15
statements. Having a check after each one would look ugly, and cause
trouble if the condition needed to be changed or if I instead decided
to check it, say, against a function.

So is this possible to do with built in code? or am I stuck with
having to put a check after each statement in?


Aside from Shawn's exception method, you're relatively limited in how
you do this. All the other methods amount to essentially what you're
doing here. There's no other loop structure in PHP that will do it any
better than what you've devised.

FWIW, I've had to do this exact thing with regard to form validation,
except I'm not looping. Check each condition, and if it fails, never
mind validating the rest of the fields.



Isn't that a little rough on the user? Wouldn't a better user  
experience be to check all the fields and report all errors back to  
the user in one pass, rather than after each element that fails?








If you're concerned about the possibility of having to replace the
$abort_now variable with a function later, you have two choices.  
First,
use an editor which does search-and-replace efficiently. Second, set  
up

a function which is called wherever you have $abort_now currently. For
the moment, have that function simply check the $abort_now variable.  
In
the future, you could have it do something else, but not have to  
change

your existing code.

Paul

--
Paul M. Foster

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




Bastien

Sent from my iPod

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



Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Phpster





On Jun 30, 2009, at 10:59 PM, Paul M Foster pa...@quillandmouse.com  
wrote:



On Tue, Jun 30, 2009 at 06:38:19PM -0700, Mary Anderson wrote:


Hi all,

 I have a php application for which I have a page which creates
temporary junk and puts it into a persistent store  (in this case a
postgres database, but that is beside the point.)

 I have a Save button which puts the stuff I really want into the
persistent store and cleans up the temporary junk.  I have a Cancel
button which only cleans up the temporary junk.

  I would really like to have the cleanup code run anytime a user
leaves the page without hitting the Save button.  Is there anyway  
to do

this?  I.e. have php code called conditionally on exiting the page?


If the user hits the Back button or exits via clicking on some  
link on
the page, there's no reasonable way to do this (Michael's cron  
versions
excepted). Because the HTTP protocol has no effective memory,  
there's no

way for it to know that the user exited without saving. You can do
various tricky things like set a $_SESSION variable, and then have it
checked at the top of each page where the user could go, and check and
clean up if the variable has a certain value. But that's pretty  
tedious.
You could execute the whole thing as part of a class, and put a  
check in

the constructor of the class (where it will be called on every page)
which cleans up if necessary.

In other words, there are ways to do this, but they are tedious. The
PHP/HTTP execution engines have no way of doing it on their own.

(Oh, there may be a way to do this with Javascript. I'm not good with
Javascript, but maybe there's some OnExit event which you could  
use to

cause a Javascript function to do an AJAX call to a PHP script which
cleans up. I dunno.)

Paul

--
Paul M. Foster

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



The js function Onunload() could do that but there is the issue if the  
user hits the back button, or moves to another page.


It's the same issue as the standard logout button. Users don't have to  
trip this to leave the site, closing the browser or moving to another  
site creates the same issues.


Doing the clean up via a cron is prolly gonna be the best option


Bastien

Sent from my iPod 


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



Re: [PHP] check a variable after EACH function

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 11:21:03PM -0400, Phpster wrote:

 On Jun 30, 2009, at 10:48 PM, Paul M Foster pa...@quillandmouse.com
 wrote:


snip


 FWIW, I've had to do this exact thing with regard to form validation,
 except I'm not looping. Check each condition, and if it fails, never
 mind validating the rest of the fields.


 Isn't that a little rough on the user? Wouldn't a better user
 experience be to check all the fields and report all errors back to
 the user in one pass, rather than after each element that fails?

blush

Well, yes. Early on I tended to do it this way, but I made my error
handling more sophisticated over time.

Actually, where I do something like this now is on some blog software I
wrote. There are numerous fields to be filled out, and if all are
filled out correctly, it updates a database and dumps some files to
disk. At each field check, I increment an error count variable if the
user screws up. And before I check each field, I check the error count.
If there are errors, then I may not update the database and dump the
files, so there's no point in checking the contents of certain fields.
For example, if the user didn't provide a title for the post, I'm not
going to go through the process of XSS checking on their post content,
since I'm not going to store it until they give me a title. I'll report
to them on the missing fields, though, and allow them to repair.

Paul
-- 
Paul M. Foster

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



Re: [PHP] PHP 5.3.0 Released!

2009-06-30 Thread Michael A. Peters

Lukas Kahwe Smith wrote:

Hello!

The PHP Development Team would like to announce the immediate release of 
PHP 5.3.0. This release is a major improvement in the 5.X series, which 
includes a large number of new features and bug fixes.


Release Announcement: http://www.php.net/release/5_3_0.php
Downloads:http://php.net/downloads.php#v5.3.0
Changelog:http://www.php.net/ChangeLog-5.php#5.3.0

regards,
Johannes and Lukas



While I don't plan on using it on my production server just yet, I am 
packaging this for centos 5.3.


One of the neat additions (I think it is an addition) that I saw in the 
release notes is phar - which looks like a really slick way to 
distribute php applications.


My i386 build is done, my x86_64 build is going (will go all the way 
through as I tweaked the rpm on an x86_64 desktop before sending to my 
mock build machine)


I won't provide binary RPM's, but for the RHEL5/CentOS 5.x community 
that wants to play with it, src.rpm will be here:


http://www.clfsrpm.net/php53/

I just have to try to rebuild some of the pecl modules, and test it to 
make sure the build doesn't segfault or give me the finger or anything 
rude like that before I upload the src.rpm.


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