Search Postgresql Archives

Re: Postgre RAISE NOTICE and PHP

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

 



On Tue, Aug 18, 2009 at 10:57 AM, Andre Lopes<lopes80andre@xxxxxxxxx> wrote:
> Hi,
>
> I'm developing a function with some checks, for example... to check if the
> e-mail is valid or not.
>
> If the e-mail is not valid I put a line with RAISE NOTICE 'E-mail not
> valid'.
>
> I need to know if it is possible to show this RAISE NOTICE when I run this
> function from PHP.

http://www.php.net/manual/en/function.pg-last-notice.php

example plpgsql function:
create or replace function tester() returns int language plpgsql as $$
BEGIN
raise notice 'whoops';
return 1;
END
$$;

example php:
<?php
$conn = pg_connect("dbname=smarlowe");
$res = pg_query("select tester()");
print pg_last_notice($conn);
print "\n";
?>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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