473,666 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php my admin - reinventing the wheel - mysql front-end

Hi Folk

I am an PHP novice.

Right now, I am redeveloping the wheel by creating my own type of PHP
MyAdmin tool for my clients so that they can manage some data. A good
exercise, but probably done before!

My question: is there something out there similar to what I describe below
or how do you go about it (I am sure that all of you have faced this problem
before)? How do you recommend I proceed?

PHP MyAdmin would not be suitable for my clients, because it contains too
much and it is too technical (e.g. i dont want them to change the structure
of the database).

So far, I have created a simple structure that allows the user to edit any
table in my database. Here is an overview of how I do it. If anyone wants
a copy of the files, please email me php at ngaru dot com.

[1] list.php - shows the data from a table in a list - allowing users to
a. delete a row
b. click on a field for a related id items (they are shown as meaningful
data from the look-up table rather than the id). For example in the list of
customers, the city is shown as the name of the city rather than the city id
(linked table)
c. click on the edit button for any row

[2] edit.php (shows a form where you can either add or update a row)
a. provides the ability to "go-through" to child data (e.g. if you are in
the customer table then you can click through to the customer order table
for that customer).

[3] to make it all work, I have created a table DEF that defines the data
structure. While I have not formally created relationships in the MySql
database (I do not know how to), this table shows them, because a field like
LIS_ID relates back tot the LIS table and a field CAM_ID relates back to the
CAM table. The DEF table describes each field with:
- name of the table it belongs to (e.g. CAM)
- field name (e.g NAM)
- field name to be used as ID in a form (e.g. campaignname) - to avoid
people knowing the exact names of the fields in the database (for security
reasons)
- field name to be used for users (e.g. Campaign Name)
- function used to validate an entry in the edit form for this field

The beauty is that, using this DEF table, the list.php and the edit.php
pages can be created for any table in the database. Those fields and tables
that are admin only I simply leave out of the DEF table.

I have also written the little function below to create a dropdown list for
look-up fields.

//creates a dropdown for a table
function dd($table, $name, $class, $select){
$sqlw = dd_where($table , dd_restricter() );
$sql = 'SELECT `ID`, `'.dd_descripto r().'` FROM `'.$table.'` '.$sqlw.'
ORDER BY `'.dd_descripto r().'`;';
$query = mysql_query($sq l);
$v = '<SELECT Name="'.$name.' " ID="'.$name.'" CLASS="'.$class .'">';
while ( $row = mysql_fetch_row ($query) ) {
$v .= '<OPTION ';
if ( $select && $row[0] == $select ) {
$v .= ' SELECTED ';
}
$v .= ' VALUE="'.$row[0].'">'.$row[1].'</OPTION>';
}
$v .= "</SELECT>";
return $v;
}

function dd_restricter () {
//returns the name of the field that contains the most meaningful
description for a record
}
function dd_where($t, $restrictt) {
$id = sgd($restrictt. '_ID');
$v = ' WHERE ';
if($t == $restrictt ) {
$v .= ' `ID` = "'.$id.'" ';
}
else {
if( is_parent($t, $restrictt) ) {
$v .= ' `'.$restrictt.' ` = "'.$id.'" ';
}
else {
$v = ' WHERE `ID` > -1 ';
}
}
return $v;
}
function sgd ($fieldname) {
//returns a user-specific value from the session table
}
Jul 17 '05 #1
2 1820
SOR
<comp.lang.ph p , windandwaves , wi*********@col dmail.com>
<Vr************ *****@news.xtra .co.nz>
<Wed, 13 Jul 2005 11:33:59 +1200>
My question: is there something out there similar to what I describe below
or how do you go about it (I am sure that all of you have faced this problem
before)? How do you recommend I proceed?


MySQL Administrator is a windows app and probably well worth a look as
it will no doubt give you a few ideas on your custom layout and editing
options .

Be sure and post a url if you get your custom editor working .

Jul 17 '05 #2
SOR wrote:
<comp.lang.ph p , windandwaves , wi*********@col dmail.com>
<Vr************ *****@news.xtra .co.nz>
<Wed, 13 Jul 2005 11:33:59 +1200>
My question: is there something out there similar to what I describe
below or how do you go about it (I am sure that all of you have
faced this problem before)? How do you recommend I proceed?


MySQL Administrator is a windows app


I was actually more interested in PHP... but I will have a look. I have not
loaded MySql on my pc so it may be hard for me.

Thank you

Nicolaas
Jul 17 '05 #3

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

Similar topics

2
2444
by: Asher Golan | last post by:
Which '.exe' file should I run in order to start the MySql Server ? How do I creat a new data base ? I learnt how to access MySql using php commands, but dont know how to create the database. Is there any GUI manager to access records stored on the MySql server ? Regards
1
1800
by: JStrummer | last post by:
I'm converting some static HTML pages to use PHP-mySQL. I will be able to add/modify/delete records via the web using phpmyadmin, but I will need to develop more user-friendly admin pages for non-technical users. I don't want to reinvent the wheel--does anyone know of any open-source packages in PHP that have your standard display-all-records screens, with links for Edit, Add, Delete, as well as subsequent pages that allow users to modify...
1
1753
by: CAS | last post by:
Hi, New on the group so forgive me if this is a FAQ... I've been looking for a tool to handle user admin (for a website I'm knocking together for a club), after all there is no point reinventing the wheel... I need something that is easy to implement, but I'm not too bothered about the actual administration side of things as we'll have a reasonably static
6
4390
by: Dmitri | last post by:
Hi there, Does anybody know what is DB2 UDB admin API equivalent to "db2 terminate" command? Some background: I'm developing monitoring application(http://chuzhoi_files.tripod.com). I want to be able to specify a node number during attachment, so I'm using sqlesetc (API for "set client attach_dbpartitionum" command). If user specifies an incorrect node number, DB2 will fail with something like:
2
1822
by: Doug | last post by:
Not that I'd actually do this... but knowing the answer would give me a bit more understanding of the .NET Framework and the base class libraries - specifically how things work in relation to my own custom classes or libraries. We could use any of the framework's classes - but lets take, for example, the ListDictionary (System.Collections.Specialized.ListDictionary). When solving some programming problem, I could (1) use the...
1
1227
by: Graham Smith | last post by:
Hi, I'd like to write a little bidirectional connector, which should sync data between two systems. Are there any components which I can use for this purpose, without reinvening the wheel? Thanks for any advice Graham Smith
11
20526
by: AnhTai | last post by:
Hi all, I've just installed MySQL 5.0 on my sun box (runing Solaris 10, install from blastwave). This is my first time with MySQL so I don't have any exp with it. I have some troubles as: - I set password for root account via this command: # mysql -h atlantis -u root mysql
2
4506
by: xkp | last post by:
Hi all, i used to use mysql front with my old mysql 3.x version. now i have upgraded to mysql 5.0 and i have just discovered mysql front is not available anymore. I really liked it cause it allowed me to edit easily all my database. Are there any valid alternative? I have tried mysql administrator but it seems to me not so easy to use as the old mysql front. regards
3
1376
by: rollo gerfollo | last post by:
Hi, I have been using MySql-Front Gmbh right up until Monday 7-14-2007, when after downloading a bunch of stuff and keeping dozens of files and windows open for a couple of days, I try to start MySql-Front Gmbh to check a data property, and it won't open up into a window, but failing at that, sits down on the TaskBar and can't get up. Is that an Operating System goof up, as I suspect, or something gone wrong with MySql-Front Gmbh (hereafter...
4
5680
by: karthikeyanck | last post by:
I'm a newbie, I've installed PHP, Apache and MySQL on my Ubuntu system I've trouble in quering the data from MySQL when using the query function within PHP. I 've created a Database "test", Table "employee", i 've two columns "username" and "password", I've data "admin" and "admin" on both username and the password columns. $u and $p variables has "admin". <?php $query = "SELECT username and password FROM employee WHERE username = $u...
0
8440
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7378
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6189
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2005
muto222
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.