Al,
Something like the following should enable you to display a list of
whatever, then click on the record id to edit the record.  This is a portion
of code which does the display, you'll need another portion to display the
record for editing.

Hugh
snip from street.php
<?php
// view list

 $table="table";
 $db="database";
 $pass="password";
 $user="user";
 $link=mysql_connect("localhost","$user","$pass");
 if (! $link) die("couldn't connect mysql");
 mysql_select_db($db,$link) or die ("couldn't open $db ".mysql_error());
 $query="select * from $table order by scientific_name";
 $result=mysql_query($query);
 print "<h3> <br>Click on an ID number to edit the information of that
record.</h3>";
 print "<table align=center width=95% cellpadding=3 cellspacing=0 border=1
bgcolor=silver bordercolor=gray>
   <tr><td align=center><h5>ID</h5></td>
   <td align=center><h5>Scientific Name (Common Name)</h5></td>
   <td align=center><h5>Address</h5></td>
   <td align=center><h5>District</h5></td>
   </tr>";
 while ($array_result=mysql_fetch_array($result))
  {
   print "<tr><td><h4><a
href=street.php?database=1&id_number=$array_result[id] title=\"click here to
edit this record\">".stripslashes($array_result[id])."</a></h4></td>
     <td><h4>".stripslashes($array_result[scientific_name])."
(".stripslashes($array_result[common_name]).")</h4></td>
     <td><h4>".stripslashes($array_result[address])."
".stripslashes($array_result[comments])."&nbsp;</h4></td>

<td><h4>".stripslashes($array_result[district])."&nbsp;</h4></td></tr>";
  }
 print "</table>";

?>
----- Original Message -----
From: "Al" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 2:14 PM
Subject: [PHP] Re: List items in table with a hypertext link


> This may be a bit more than you are looking for.
>
> http://sourceforge.net/projects/phpmyedit/
>
>
>
> Mike Tuller wrote:
> > I have been looking for an example of how to create a listing of items
> > in a table where you have the first item in the list have a link so that
> > when you click on it, it will open a page for editing the contents of
> > that item. So for instance you have a list of employees, and you want to
> > change their phone number you could go to the list and click on the
> > employee id number and it would open a page where you can edit the
> > employee information.
> >
> > I haven't been able to find a good example of this, so if anyone knows
> > where I could find one, please let me know.
> >
> > Mike
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to