Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 9D59047642B for ; Thu, 9 May 2002 18:13:47 -0400 (EDT) Received: from leo.pcisys.net (leo.pcisys.net [207.76.102.240]) by postgresql.org (Postfix) with ESMTP id C891747591F for ; Thu, 9 May 2002 18:13:10 -0400 (EDT) Received: from [208.202.106.186] (moe1.meg106-186.cos.pcisys.net [208.202.106.186]) by leo.pcisys.net (8.12.1/8.12.1) via ESMTP id g49MDCOh003895 for ; Thu, 9 May 2002 16:13:12 -0600 (MDT) env-from (hierophant@pcisys.net) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.4 Date: Thu, 09 May 2002 16:13:12 -0600 Subject: Re: Mailtos and links from a query result table! From: Keary Suska To: Postgres-PHP Message-ID: In-Reply-To: <3CD2936400024AD8@nplex.globo.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Archive-Number: 200205/47 X-Sequence-Number: 1179 on 5/9/02 2:32 PM, angelo.rigo@globo.com purportedly said: > Hi! > I need to make mailtos and hiperlinks in a query result table > i dont know wich variable to pass to the to make this happen Neither can we, since you don't give us your table schema, or the database calls. What is your select statement? What function are you using to retrieve rows? > my code below is not working! any idea? No. We have no idea what "not working" means. If you want help, you will need to explicitly indicate what is not happening the way that you would expect. And you should include all code for the algorithm (you can leave out the pg_connect(), as that shouldn't be necessary, and is a security risk). The snippet below is useless to determine what may be wrong. > printf ("%s%s href='mailto:$myrow[19]'>%s href="$myrow[9]">%s%s%s > ",$myrow[1], $myrow[2], $myrow[3], $myrow[19], $myrow[9], $myrow[10]); > $row++; > } > while ($row < $numrows); > printf (" > "); > pg_close($db); A tip: on top of using associative arrays as was mentioned in a previous response, your use of printf() is superfluous and functions only to make your code more difficult to read. This isn't C--use print(): print << $myrow[1] $myrow[2] $myrow[3] $myrow[19] $myrow[9]$myrow[10] EOS; Much cleaner, no? Keary Suska Esoteritech, Inc. "Leveraging Open Source for a better Internet"