Search Postgresql Archives

Re: plphp: PHP Warning: Call-time pass-by-reference has been deprecated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sure-


CREATE or REPLACE FUNCTION email_activated_member ()
RETURNS trigger AS $$

$new=$_TD['new'];
$old=$_TD['old'];

if(($_TD['event']=='INSERT' and $new['active']='t') or
($_TD['event']=='UPDATE' and $new['active']=='t' and
$old['active']=='f')) {
  $link=$_TD['new'];

  $sql="select *
    from groups
    where id=$link[group_id]";

  $result=spi_exec_query($sql);

  if($result) {
    $group=spi_fetch_row($result);
  }

  if($group) {
    $message=<<<EOT

Greetings...

Here are your link details:

Name: $link[name]
URL: $link[url]
Email: $link[email]
Contact Name: $link[contact_name]
Description: $link[description]

Thanks,
$group[name]
$group[url]

EOT;

    if(!empty($link['email'])) {
      $to=empty($link['contact_name']) ?
$link['email'] : "$link[contact_name] <$link[email]>";

      mail($to,
        "Link Activated - $group[name]!",
        $message,
        "From: {$group[name]} <$group[email]>\r\n");
    }
  }
}

$$ LANGUAGE 'plphpu';

-- CREATE TRIGGER email_activated_member AFTER INSERT
or UPDATE ON links FOR EACH ROW EXECUTE PROCEDURE
email_activated_member();


It justs lets people know when their link has been
activated.

CSN



--- Roman Neuhauser <neuhauser@xxxxxxxxxx> wrote:

> # cool_screen_name90001@xxxxxxxxx / 2005-08-11
> 16:49:25 -0700:
> > I'm using PHP5, and I'm not passing by reference.
> My
> > first stop WAS plphp.commandprompt.com, but none
> of
> > their mailing list links for plphp work.
> 
>     Can you post the code that triggers the warning?
> 
> -- 
> How many Vietnam vets does it take to screw in a
> light bulb?
> You don't know, man.  You don't KNOW.
> Cause you weren't THERE.            
> http://bash.org/?255991
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux