473,473 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Building Dynamic Pages For Editing Database Records

I need to dynamically create a page that allows me to edit records in a
a database table. Basically, something very similar to how PHP MyAdmin
works only slighly less complicated. There does not need to be the
ability to edit the structure of the database or tables or anything like
that, simply a listing of the records and the ability to either
edit/delete or create a new record in the table.

I have searched google for a long time but found nothing. Help will be
appreciated.
Jun 2 '08 #1
4 1419
Ronald Raygun wrote:
>I need to dynamically create a page that allows me to edit records in a
a database table. Basically, something very similar to how PHP MyAdmin
works only slighly less complicated. There does not need to be the
ability to edit the structure of the database or tables or anything
like that, simply a listing of the records and the ability to either
edit/delete or create a new record in the table.

I have searched google for a long time but found nothing. Help will be
appreciated.
Well I put
php database admin form
into google and clicked "I'm feeling lucky" and found one??
Jun 2 '08 #2
Ronald Raygun wrote:
I need to dynamically create a page that allows me to edit records in a
a database table. Basically, something very similar to how PHP MyAdmin
works only slighly less complicated. There does not need to be the
ability to edit the structure of the database or tables or anything like
that, simply a listing of the records and the ability to either
edit/delete or create a new record in the table.

I have searched google for a long time but found nothing. Help will be
appreciated.
What is so difficult? Just build an array with the database fields,
generated a table with <tr>s between each field and have there be two
columns -- one with the name printed and the other with text input and
have the name of the text field be the name of the db field. Then add a
submit button and process the form. In the php target, simply extract
the values of all the fields and do an update of the db. Have the id
field always be first so that you know how to do the where clause.

You can get the field names with mysql_list_fields, although it is
deprecated. You could use mysql_query with "SHOW COLUMNS FROM table foo".

This seems like less than an hour's work.
Jun 2 '08 #3
sheldonlg wrote:
Ronald Raygun wrote:
>I need to dynamically create a page that allows me to edit records in
a a database table. Basically, something very similar to how PHP
MyAdmin works only slighly less complicated. There does not need to be
the ability to edit the structure of the database or tables or
anything like that, simply a listing of the records and the ability to
either edit/delete or create a new record in the table.

I have searched google for a long time but found nothing. Help will be
appreciated.

What is so difficult? Just build an array with the database fields,
generated a table with <tr>s between each field and have there be two
columns -- one with the name printed and the other with text input and
have the name of the text field be the name of the db field. Then add a
submit button and process the form. In the php target, simply extract
the values of all the fields and do an update of the db. Have the id
field always be first so that you know how to do the where clause.

You can get the field names with mysql_list_fields, although it is
deprecated. You could use mysql_query with "SHOW COLUMNS FROM table foo".

This seems like less than an hour's work.
I missed that you want it like phpMyAdmin. In that case, have multiple
columns, each being the name of a different field and have the rows be
the data selected. In that case, add buttons for update.
Jun 2 '08 #4
On Sat, 10 May 2008 17:27:24 +0100, in comp.lang.php Ronald Raygun
<in*****@domain.com>
<hp******************************@bt.comwrote:
>| I need to dynamically create a page that allows me to edit records in a
| a database table. Basically, something very similar to how PHP MyAdmin
| works only slighly less complicated. There does not need to be the
| ability to edit the structure of the database or tables or anything like
| that, simply a listing of the records and the ability to either
| edit/delete or create a new record in the table.
|
| I have searched google for a long time but found nothing. Help will be
| appreciated.
This is by no means a simple task.
I've written something like this but at the present time it is not
worthy of distribution. There are too many manual steps still required
to get it to work.

I'll do a bit more work on it and put the code somewhere to make it
available. This could take a while though :-(
Jun 2 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: Lyle Fairfield | last post by:
In a recent thread there has been discussion about Data Access Pages. It has been suggested that they are not permitted on many or most secure sites. Perhaps, that it is so, although I know of no...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
8
by: Sandy Pittendrigh | last post by:
I have a how-to-do-it manual like site, related to fishing. I want to add a new interactive question/comment feature to each instructional page on the site. I want (registered) users to be able...
9
by: Mike Hofer | last post by:
BACKGROUND: We've designed a Website for a client that will be deployed across multiple physical locations. The site will be hosted from a corporate NOC, and administered by the IT group there. ...
1
by: Matt Adamson | last post by:
Guys, We have an issue where we need to control access to specific web pages e.g. if one user is editing a purchase requisition another user shouldn't be able to perform any actions on it. I...
10
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're...
5
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But...
7
by: Roarke | last post by:
Forgive me if this is too long/too simple - I am new to this! I have an htm page with a "post" form. This has 2 droplists, the variables of which are posted to a php page. This page queries a...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.