pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: angelo.rigo@globo.com
To: pgsql-php@postgresql.org
Subject: mailto´s hyperlink solution
Date: Thu, 16 May 2002 15:16:34 -0300
Message-ID: <3CD293640004B005@nplex.globo.com> (raw)

Thank´s for who gave me support!

I fix the problem of making mailto´s and hyperlinks from a select, using
the pg_fetch_array function the code is below:

<?php
$db = pg_connect("dbname=db user=me");
$query = "SELECT nome, prof, email, hp FROM table";
$result = pg_exec($db, $query);
if (!$result) {printf ("ERROR"); exit;}
$numrows = pg_numrows($result);
$row=0;
printf ("<table border=0>
");
printf ("<tr bgcolor='#FFCC00'><td><b>Nome</b></td><td><b>Profisão</b></td><td><b>Email</b></td><td><b>Website</b></td></tr>
");
do
{
$myrow = pg_fetch_array ($result,$row);
  if($row % 2)  {
    $bgcolor="#CCCCCC";
    }
  else {
    $bgcolor="#EEF0EE";
    }
printf ("<tr bgcolor='$bgcolor'><td>%s</td><td>%s</td><td><a href='mailto:$myrow[email]'>%s</a></td><td><a
href='http://$myrow[hp]' target='_blank'>%s</a></td></tr>
", $myrow[nome], $myrow[prof], $myrow[email], $myrow[hp]);
$row++;
}
while ($row < $numrows);
printf ("</table>
");
pg_close($db);
?>






________________________________________
A busca mais veloz e precisa da internet. Acesse agora: http://www.zoom.com.br.




Message-ID: <3CD293640004B005@nplex.globo.com>
Permalink:  ../3CD293640004B005@nplex.globo.com/
Also on:    postgresql.org/message-id/3CD293640004B005@nplex.globo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: angelo.rigo@globo.com
  Subject: Re: mailto´s hyperlink solution
  In-Reply-To: <3CD293640004B005@nplex.globo.com>
  References: <3CD293640004B005@nplex.globo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox