I was wondering if someone can help me out
| From: | Jeroen van Vlierden | Date: | Thu, 19 Jun 2003 07:50:42 +0000 |
| Subject: | I was wondering if someone can help me out | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6113@lists.php.net to get a copy of this message | ||
I am a bit stuck at the moment. Don't know what is the smoothest path to
what I want. I have been using PHP and PEAR to generate a nice HTML-table
(with the package table.php) from a MySQL-query on a database with people's
names, adresses, e-mail adresses etc.
Looks good but they are all flat texts
I want to change a few texts into hyperlinks. To start with
- the name of each person in a table row
- the e-mail adress of each person in a table row
the first link should start a form in which the person's name, adress, etc
can be changed and inserted into the MYSQL table
the second one is simpler, it should just start the e-mail program on the
client side.
Is this possible with PEAR functions? Or should I use plain PHP? Does anyone
know of simmilar examples to be found on the internet?
thx
Jeroen
P.s. another option would be to add an edit image (pencil) at the end of
each table row what could do the same as the first mentioned hyperlink.
so the code now is something like
<?php
$tableStyle = "bgcolor=#FFFFFF border=1 width=150 cellpadding=1
cellspacing=2 ";
require_once ("HTML/Table.php");
$colHeaders = array("Name", "Address", "e-mail");
$tableB = new HTML_Table($tableStyle);
$tableB->addRow($colHeaders);
$link = mysql_connect("localhost","","")
or die("Kan de verbinding met de database niet maken" . mysql_error());
$db = mysql_query("USE mydb;")
or die("can't use db'" . mysql_error());
$query = mysql_query("SELECT * FROM mytable;")
or die("query failed " . mysql_error());
while ($row = mysql_fetch_assoc($query))
{
$tableB->addRow(array($row["Name"],$row["Address"], $row["email"]);
}
mysql_free_result($query);
$tableB->display();
mysql_close($link);
?>