Re: Editing a Database
| From: | eric | Date: | Tue, 18 Jul 2000 04:15:39 +0000 |
| Subject: | Re: Editing a Database | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7023@lists.php.net to get a copy of this message | ||
This ought to get you started:
<table>
<% while ($row=mysql_fetch_row($query)) { %>
<tr>
<td><% echo $row[0] %></td>
<td><% echo $row[1]; %></td>
<td><% echo $row[2]; %></td>
<td><% echo $row[3]; %></td>
<td><% echo $row[4]; %></td>
<td><a href="edit_thing.phtml?id=<% echo $row[0]; %>">Edit</a>
</td>
</tr>
<% } %>
</table>
Just make the right query.
Jeff Wilhelm wrote:
> OK, this one is pretty straightforward, since it's basically the same thing
> over and over in a loop, but my problem is with getting it right the first
> time, so it'll repeat correctly. As it is now I use phpMyAdmin to make
> modifications to the site tables in the site database. What I want to do is
> make a web interface so that I can delete records without having to go in
> phpMyAdmin. For example, let's say that my database is called database and
> my table is called table. In the table let's say I have three fields,
> product, price, and use (not the real names, but this is just for an
> example).
>
> Basically I want to be able to see the following:
>
> products price use
> fork 5.00 blah1 [delete]
> spoon 6.00 blah2 [delete]
> knife 7.00 blah3 [delete]
>
> So basically I want the entire table listed (simple loop) and the ability to
> delete any row from the database. I have a pretty good idea of how to do it,
> but if someone could give me a little help it'd be great.
>
> Thanks!
> -Jeff
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net