What syntax gives me an editable field?

I am getting my feet wet using MySQL with phpMyAdmin online.  I want to make one of the fields editable in on a web page.  What is the appropriate syntax?
frugalmuleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

frugalmuleAuthor Commented:
Ty
0
Dave BaldwinFixer of ProblemsCommented:
It takes more than just 'appropriate syntax'.  It requires PHP code to get the information from the database, a form page to display and edit the data, and more PHP code to update the database from the form.
0
frugalmuleAuthor Commented:
okay ty!

I'm looking to put together a simple example of what that might look like?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Dave BaldwinFixer of ProblemsCommented:
What do you have so far?  http://www.php.net/ is a wonderful resource with examples of almost everything you could want.  This search https://www.google.com/search?q=updating+mysql+with+php will show you quite a few tutorials to help get you started.  And W3Schools also has examples of all the functions you need.  http://www.w3schools.com/php/php_mysql_update.asp
0
PortletPaulfreelancerCommented:
BUT:

before diving in through google, be aware there are good and bad out there - many more bad than good.
For a list of what's good and bad to help you make decisions, please refer to this:
AntiPHPatterns and AntiPHPractices

The other - very important - item of note is that soon PHP will make it's original MySQL API redundant - so if you are staring out fresh use "mysqli" or "PDO".
see: PHP MySQL: Deprecated as of PHP 5.5.0
(don't worry it is not the database MySQL that is affected - just the "API" using the same name.)

Both those articles are written by Ray Paseur and if you visit his profile, click the 'Activity' tab, then click the 'Articles' under that - you will see a long list of PHP articles - these are a source of gold.
0
Ray PaseurCommented:
I'm going to write a Hello World article about data base table maintenance scripts.  This question has come up too many times to keep answering it repeatedly when an article should exist to cover all the points.  But until then, here are the basics:

1. A script reads the information from the table and produces a web page with one data element for each row of the table.  These data elements contain links to an update script.

2. The update script reads one row from the table and prepopulates an HTML form with the information from the row.

3. The action script takes the information from the row, as modified by the (human) client and uses MySQL to UPDATE the row.

4. A separate link is used to INSERT a net-new row into the table.

5. A separate link is used to DELETE a row from the table.  The DELETE script asks the "are you sure?" question.

Information-only requests are done with GET.  Changes to the data model are done with POST.

If that helps you get started, good.  If not, please stand by and I'll show you the code to accomplish this as soon as my article is written and approved.

Best regards, ~Ray
0
frugalmuleAuthor Commented:
Still a little lost
0
Ray PaseurCommented:
lost
Yeah, I get it.  This stuff does not come from intuition.  It comes from years of structured study and practice.  Hang in there while I write the article!
0
frugalmuleAuthor Commented:
thank you Ray. If you can simplify it now that's something that can be replicated by someone with no experience.then perhaps it can be simplified down even further.
0
frugalmuleAuthor Commented:
some tests are explained that as an example rather than a detailed explanation.
0
Ray PaseurCommented:
Some good learning resources here -- check the books.  Worth the time and money!  
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html

It will take me a while to put a good example together.
0
Dave BaldwinFixer of ProblemsCommented:
I applaud Ray for writing an example.  His description above is exactly what I do on dozens of pages.  And he teaches PHP so it makes sense for him to write the article.

I am less willing to write a mini-application to answer a question when I'm not seeing any particular effort on the part of the asker.
0
frugalmuleAuthor Commented:
I've read every link but don't want to make a science project out of editing one field. I just don't have that kind of time.  Thanks for the suggestions though.
0
Dave BaldwinFixer of ProblemsCommented:
That's the problem, it isn't just one field.  It is a process with a set of requirements like Ray described above.  It can not be simplified to be only a one-line procedure, there are too many moving parts whether it is one or a thousand fields.

All programming is science projects.
0
Ray PaseurCommented:
This is totally irrelevant, but I just couldn't help myself, so I'm posting it here.
http://www.hammacher.com/Product/Default.aspx?sku=84117

Working on the example and article right now... ~Ray
0
Dave BaldwinFixer of ProblemsCommented:
I like that, Ray.  I just don't think I could drink that much at one time though.
0
Ray PaseurCommented:
The article is not complete because I have yet to add INSERT and DELETE functionality, but this much of it should be useful to you.  Unfortunately there are images embedded in the article and those are not displayed here, but they are only screen captures of the scripts in action, so if you run the scripts you'll see what is shown in the missing images.  I haven't done a good job of proofreading, either, so please post back with your questions -- it will help me make the article better.

The CRUD Functions
CRUD, meaning "Create, Read, Update, Delete" is a common term to data base developers.  It describes the essential functions of data base table maintenance.  This article lays out a minimum example showing how PHP and MySQLi work together to create a table maintenance script.  Of course you could use phpMyAdmin and get a lot more capability, but this is intended to be a teaching example showing the moving parts.  It can also serve as a model for maintenance of any table, with the classic example being a personal address book.

The CRUD functions map to the SQL query commands more or less like this:
  Create = INSERT
  Read = SELECT
  Update = UPDATE
  Delete = DELETE

The HTTP Requests
In our scripts we will use both GET and POST request methods.  HTTP protocols tell us that GET can only be used when there is no change in the data model, therefore we will only be able to use the GET method for scripts that use SELECT queries.  The other three functions will require us to use POST method requests.  The method we use will be identified in the HTML form tag, via the method attribute.

Getting Started
In order for any software project to be successful, we must have a test data set.  If you're wondering why, please read this other article, then come back here.  Our first script creates the test data in the form of a small data base table with a list of names.  Our table maintenance script(s) will be written to operate on the table this script creates.

Here is some annotation about the test data creation process.

Lines 2-3:
We set our script up so that we see all of the possible errors, warnings and notices.  This is critically important in the development environment.

Lines 20-23:
You should be able to put your own credentials into these lines, install this script and run it without any other changes.

Lines 25-38:
This shows how to connect to the data base engine and select the named data base.  It tests for connection errors and makes them visible.  You might try putting in a bad password to see what the error handling does.

Line 41:
This destroys the table so that we can re-create it as many times as necessary.  This gives us a consistent starting point for our tests.  Since we will be performing "maintenance" on this table, its contents will change.  If we set up a consistent set of tests, we would also want to set up a consistent starting point for the tests.

Lines 44-53:
This is the SQL query to CREATE the table.

Lines 55-71:
This is how to run a MySQLi query and test for success.  If the query fails, we use trigger_error() to visualize the error information.

Line 74:
This is the iterator that goes through our test data and loads the table.

Lines 77-78:
This escapes the data for safe use in the query string.  Because one of our names has an apostrophe in it, the escape process is required to tell MySQLi that the apostrophe is not a control character, but is actually part of the data we want to insert.  As a practical matter, every data element that is used in a query string should be escaped.

Lines 80-84:
Creates the query string and runs the query.

Lines 86-99:
Tests for query success or failure and visualizes error information, if any.

Lines 101-103:
Reports the AUTO_INCREMENT key for each row of data that is inserted into our test data set.

<?php // RAY_EE_table_maintenance_create.php
ini_set('display_errors', TRUE);
error_reporting(E_ALL);
echo '<pre>';


// THIS SCRIPT CREATES A TEST DATA SET


// CREATE AN ARRAY OF NAMES TO USE FOR TEST DATA
$test_names_arrays = array
( array( "fname" => "Walter" , "lname" => "Williams" )
, array( "fname" => "Ray"    , "lname" => "Paseur"   )
, array( "fname" => "Bill"   , "lname" => "O'Reilly" )
)
;


// DATABASE CONNECTION AND SELECTION VARIABLES - GET THESE FROM YOUR HOSTING COMPANY
$db_host = "localhost"; // PROBABLY THIS IS OK
$db_name = "??";
$db_user = "??";
$db_word = "??";

// OPEN A CONNECTION TO THE DATA BASE SERVER AND SELECT THE DB
$mysqli = new mysqli($db_host, $db_user, $db_word, $db_name);

// DID THE CONNECT/SELECT WORK OR FAIL?
if ($mysqli->connect_errno)
{
    $err
    = "CONNECT FAIL: "
    . $mysqli->connect_errno
    . ' '
    . $mysqli->connect_error
    ;
    trigger_error($err, E_USER_ERROR);
}

// ALLOW US TO RECREATE AND RELOAD FOR MUTIPLE TESTS
$mysqli->query('DROP TABLE EE_maintenance');

// CREATING A TABLE FOR OUR TEST DATA
$sql
=
"
CREATE TABLE EE_maintenance
( id    INT         NOT NULL AUTO_INCREMENT PRIMARY KEY
, fname VARCHAR(24) NOT NULL DEFAULT ''
, lname VARCHAR(24) NOT NULL DEFAULT ''
)
"
;

// RUN THE QUERY TO CREATE THE TABLE
$res = $mysqli->query($sql);

// IF mysqli::query() RETURNS FALSE, LOG AND SHOW THE ERROR
if (!$res)
{
    $err
    = 'QUERY FAILURE:'
    . ' ERRNO: '
    . $mysqli->errno
    . ' ERROR: '
    . $mysqli->error
    . ' QUERY: '
    . $sql
    ;
    trigger_error($err, E_USER_ERROR);
}

// LOADING OUR DATA INTO THE TABLE
foreach ($test_names_arrays as $person)
{
    // ESCAPE THE DATA FOR SAFE USE IN A QUERY
    $safe_fn  = $mysqli->real_escape_string($person['fname']);
    $safe_ln  = $mysqli->real_escape_string($person['lname']);

    // CONSTRUCT THE QUERY USING THE ESCAPED VARIABLES
    $sql = "INSERT INTO EE_maintenance ( fname, lname ) VALUES ( '$safe_fn', '$safe_ln' )";

    // RUN THE QUERY TO INSERT THE ROW
    $res = $mysqli->query($sql);

    // IF mysqli::query() RETURNS FALSE, LOG AND SHOW THE ERROR
    if (!$res)
	{
	    $err
	    = 'QUERY FAILURE:'
	    . ' ERRNO: '
	    . $mysqli->errno
	    . ' ERROR: '
	    . $mysqli->error
	    . ' QUERY: '
	    . $sql
	    ;
	    trigger_error($err, E_USER_ERROR);
	}

    // GET THE AUTO_INCREMENT ID OF THE RECORD JUST INSERTED
    $id  = $mysqli->insert_id;
    echo "MySQLI INSERTED A ROW CONTAINING <b>$safe_fn $safe_ln</b> WITH AUTO_INCREMENT ID = $id" . PHP_EOL;
}

Open in new window

Listing the Table
CRUD is sometimes abbreviated CRUDL, giving a nod to the idea that we need to be able to list the data as well as manipulate it.  This script will list the table.  We can return to this script many times during our development to see what our programming has done to the data in the table.

Lines 10-29:
Just like our create script, this is our data base hook-up.

Lines 32-44:
This is our SELECT query.  Notice that I did not use SELECT * but instead chose to list the names of the columns that I wanted to SELECT.  SELECT ALL is an anti-practice and is to be avoided.  Notice also that I constructed the query in several lines.  The SQL interpreter does not care about this, and I find that when I need to change a query the multi-line format makes changes easier and helps me minimize errors.

Lines 47-59:
This runs the SELECT query and visualizes any errors.

Lines 62-65:
This is the iterator that shows us the rows of the results set created by the SELECT query.

<?php // RAY_EE_table_maintenance_list.php
ini_set('display_errors', TRUE);
error_reporting(E_ALL);
echo '<pre>';


// THIS SCRIPT LISTS A TEST DATA SET


// DATABASE CONNECTION AND SELECTION VARIABLES - GET THESE FROM YOUR HOSTING COMPANY
$db_host = "localhost"; // PROBABLY THIS IS OK
$db_name = "??";
$db_user = "??";
$db_word = "??";

// OPEN A CONNECTION TO THE DATA BASE SERVER AND SELECT THE DB
$mysqli = new mysqli($db_host, $db_user, $db_word, $db_name);

// DID THE CONNECT/SELECT WORK OR FAIL?
if ($mysqli->connect_errno)
{
    $err
    = "CONNECT FAIL: "
    . $mysqli->connect_errno
    . ' '
    . $mysqli->connect_error
    ;
    trigger_error($err, E_USER_ERROR);
}

// CREATING A QUERY TO LIST THE TEST DATA
$sql
=
"
SELECT
  id
, fname
, lname
FROM
  EE_maintenance
ORDER BY
  lname
"
;

// IF mysqli::query() RETURNS FALSE, LOG AND SHOW THE ERROR
if (!$res= $mysqli->query($sql))
{
    $err
    = 'QUERY FAILURE:'
    . ' ERRNO: '
    . $mysqli->errno
    . ' ERROR: '
    . $mysqli->error
    . ' QUERY: '
    . $sql
    ;
    trigger_error($err, E_USER_ERROR);
}

// PRINT OUT THE ROWS OF THE TABLE
while ($row = $res->fetch_object())
{
    print_r($row);
}

Open in new window

Choosing a Row For Update
The next script builds upon our "list" script by adding an HTML form that will let us select a row for updating.  As you can see, it's the same script all the way to line 61.  But instead of just printing out the rows, we create a tabular display and wrap the display in a form.

Line 62: This tells the browser that when the form is submitted, it is to be submitted to a separate action script, and because we did not specify the method attribute, it will create a GET-method request, presenting the form input controls in the URL of the action script.

Line 68:
We choose an input of type="radio" because we want one and only one selection from the rows of our test data set.  We give it the name="id" which makes sense because the AUTO_INCREMENT column name is "id" and this parallel construction, aligning the column names and the form control names, helps us keep our thinking straight.

When we run this script we will get a web page that looks something like this:

When we make a selection and submit the form,  we will create a URL like this:
http://path/to/RAY_EE_table_maintenance_update.php?id=2

<?php // RAY_EE_table_maintenance_form.php
ini_set('display_errors', TRUE);
error_reporting(E_ALL);
echo '<pre>';


// THIS SCRIPT LISTS A TEST DATA SET IN AN HTML FORM SO WE CAN CHOOSE A ROW TO UPDATE


// DATABASE CONNECTION AND SELECTION VARIABLES - GET THESE FROM YOUR HOSTING COMPANY
$db_host = "localhost"; // PROBABLY THIS IS OK
$db_name = "??";
$db_user = "??";
$db_word = "??";

// OPEN A CONNECTION TO THE DATA BASE SERVER AND SELECT THE DB
$mysqli = new mysqli($db_host, $db_user, $db_word, $db_name);

// DID THE CONNECT/SELECT WORK OR FAIL?
if ($mysqli->connect_errno)
{
    $err
    = "CONNECT FAIL: "
    . $mysqli->connect_errno
    . ' '
    . $mysqli->connect_error
    ;
    trigger_error($err, E_USER_ERROR);
}

// CREATING A QUERY TO LIST THE TEST DATA
$sql
=
"
SELECT
  id
, fname
, lname
FROM
  EE_maintenance
ORDER BY
  lname
"
;

// IF mysqli::query() RETURNS FALSE, LOG AND SHOW THE ERROR
if (!$res= $mysqli->query($sql))
{
    $err
    = 'QUERY FAILURE:'
    . ' ERRNO: '
    . $mysqli->errno
    . ' ERROR: '
    . $mysqli->error
    . ' QUERY: '
    . $sql
    ;
    trigger_error($err, E_USER_ERROR);
}

// PRINT OUT THE ROWS OF THE TABLE WITH UPDATE LINKS
$out = '<form action="RAY_EE_table_maintenance_update.php">' . PHP_EOL;
$out .= '<table>' . PHP_EOL;
while ($row = $res->fetch_object())
{
    $out .= '<tr>'
    . '<td>'
    . '<input type="radio" name="id" value="'
    . $row->id
    . '" />'
    . '</td>'
    . '<td>'
    . $row->fname
    . ' '
    . $row->lname
    . '</td>'
    . '</tr>'
    . PHP_EOL
    ;
}
$out .= '</table>' . PHP_EOL;
$out .= '<input type="submit" />' . PHP_EOL;
$out .= '</form>';
echo $out;

Open in new window

A Script to Update One Row
The update script has two purposes.  It can be called via the GET method to create a form with the row information to allow updates, or it can be called via the POST method to perform an update.  The script may appear to be "upside down" because the GET-method request will always come first, but this script organization makes the programming logic easier to write.  Lines 70-116 handle the GET request to create the form.  Lines 31-68 handle the POST request to perform the updates.

Lines 34-37:
Every field is escaped for safe use in the query.  It does no harm to escape a numeric field, so it's a good habit to escape all of the data elements that will go into the query.

Lines 39-64:
Create and run the UPDATE query, and visualize any errors that arise.

Line 67:
After the POST-method call and the updates to the row, the script will run the GET-method part to allow the client to confirm the updates or to change the updates.  To trigger this, we copy the $id value into the GET array, just as if it had been in the URL.

Line 73:
This would be a good place to consider using filter_var() or similar sanity checking.  If our GET-method request contained a useless value, we might not get the expected information.  By casting to integer, many "garbage" values will turn into zero, and there will never be a row in our table with a key of zero.

Lines 75-102:
SELECT one row from our table, based on the contents of $_GET['id'].

Line 105:
Retrieve one row (because of the LIMIT clause in the query) -- no iterator is needed here.

Line 106:
If the query succeeded but we found no data, there is a communication mixup of some sort.  This could happen if a client bookmarked a page, then subsequently deleted the associated row.  Unlikely, so we don't make a big deal out of it.

Lines 108-115:
We create an HTML form with method="post" and no action= attribute.  Because there is no URL given in the form tag, when the client submits the form, the browser will make the POST-method request to this script's URL, triggering the processing at lines 31-68.

Upon running this script we will first see a form that looks something like this.

And we can type our changes directly into the form, overwriting the contents of the input controls.

This process will be repeatable until the client navigates away from the page, so a typographical error will not be a big deal; the client can just correct it and move on.  After the updates are complete, the list of information will have changed to something like this.

<?php // RAY_EE_table_maintenance_update.php
ini_set('display_errors', TRUE);
error_reporting(E_ALL);
echo '<pre>';


// THIS SCRIPT LETS US UPDATE A SINGLE ROW


// DATABASE CONNECTION AND SELECTION VARIABLES - GET THESE FROM YOUR HOSTING COMPANY
$db_host = "localhost"; // PROBABLY THIS IS OK
$db_name = "??";
$db_user = "??";
$db_word = "??";

// OPEN A CONNECTION TO THE DATA BASE SERVER AND SELECT THE DB
$mysqli = new mysqli($db_host, $db_user, $db_word, $db_name);

// DID THE CONNECT/SELECT WORK OR FAIL?
if ($mysqli->connect_errno)
{
    $err
    = "CONNECT FAIL: "
    . $mysqli->connect_errno
    . ' '
    . $mysqli->connect_error
    ;
    trigger_error($err, E_USER_ERROR);
}

// IF THERE IS A POST-METHOD REQUEST, UPDATE THE ROW
if (!empty($_POST))
{
    // ESCAPE THE DATA FOR USE IN THE QUERY
    $id    = $mysqli->real_escape_string($_POST['id']);
    $fname = $mysqli->real_escape_string($_POST['fname']);
    $lname = $mysqli->real_escape_string($_POST['lname']);

    // CREATE AND RUN THE UPDATE QUERY, TEST FOR ERRORS
    $sql
    =
    "
    UPDATE EE_maintenance
    SET
      fname  = '$fname'
    , lname  = '$lname'
    WHERE
      id = $id
    LIMIT 1
    "
    ;
    if (!$res= $mysqli->query($sql))
	{
	    $err
	    = 'QUERY FAILURE:'
	    . ' ERRNO: '
	    . $mysqli->errno
	    . ' ERROR: '
	    . $mysqli->error
	    . ' QUERY: '
	    . $sql
	    ;
	    trigger_error($err, E_USER_ERROR);
    }

    // SIMULATE A GET-METHOD REQUEST TO CAUSE THE UPDATED ROW TO BE LISTED AGAIN
    $_GET['id'] = $id;
}

// IF THERE IS A GET-METHOD REQUEST PUT UP A FORM TO ALLOW UPDATES
if (!empty($_GET['id']))
{
    $id = (int)$_GET['id'];

    // SELECT ONE ROW OF THE TEST DATA
    $sql
    =
    "
    SELECT
      id
    , fname
    , lname
    FROM
      EE_maintenance
    WHERE
      id = $id
    LIMIT 1
    "
    ;
    if (!$res= $mysqli->query($sql))
	{
	    $err
	    = 'QUERY FAILURE:'
	    . ' ERRNO: '
	    . $mysqli->errno
	    . ' ERROR: '
	    . $mysqli->error
	    . ' QUERY: '
	    . $sql
	    ;
	    trigger_error($err, E_USER_ERROR);
	}

    // RETRIEVE ONE ROW
    $row = $res->fetch_object();
    if (!$row) trigger_error("NO DATA FOUND FOR ID=$id", E_USER_ERROR);

    // CREATE A FORM TO ALLOW UPDATES
    $out = '<form method="post">' . PHP_EOL;
    $out .= '<input type="hidden" name="id" value="' . $id . '" />' . PHP_EOL;
    $out .= 'fname: <input name="fname" value="' . $row->fname . '" />' . PHP_EOL;
    $out .= 'lname: <input name="lname" value="' . $row->lname . '" />' . PHP_EOL;
	$out .= '<input type="submit" />' . PHP_EOL;
	$out .= '</form>';
	echo $out;
}

Open in new window

Conclusion
Even though the example here is "drop dead simple" it shows all of the essential moving parts of CRUD table maintenance.  From this example you can build your own web scripts that allow you to update data base information through a web interface.

References and Required Reading
http://php.net/manual/en/mysqli.overview.php
http://php.net/manual/en/class.mysqli.php
http://php.net/manual/en/class.mysqli-stmt.php
http://php.net/manual/en/class.mysqli-result.php
http://php.net/manual/en/class.mysqli-warning.php
http://php.net/manual/en/class.mysqli-sql-exception.php <-- Failed PHP 5.3+, MySQL 5.1+
http://php.net/manual/en/mysqli.construct.php
http://php.net/manual/en/mysqli.real-escape-string.php
http://php.net/manual/en/mysqli.query.php
http://php.net/manual/en/mysqli.errno.php
http://php.net/manual/en/mysqli.error.php
http://php.net/manual/en/mysqli.insert-id.php
http://php.net/manual/en/mysqli-result.num-rows.php
http://php.net/manual/en/mysqli-result.fetch-array.php
http://php.net/manual/en/mysqli-result.fetch-object.php
0
Dave BaldwinFixer of ProblemsCommented:
Frequently, the List, Edit, Update, and Delete functions are all on a single page because it is more convenient for the user.  When the page is first opened, a list of the items in the table is displayed below a form for editing the data.  Typically, there is a column with the word 'Edit' and another with 'Delete'.  If you click on 'Edit', the page puts the data from the table into the form so you can edit it.  At the bottom of the form is a button to 'Submit' or 'Save' the edited data.  If you click on 'Delete', you should see a pop-up that asks 'Are You Sure?' to give you a second chance in case you didn't really mean to do that.
0
Ray PaseurCommented:
@Dave, right.  I'm drawing it together even now!  If HTML had been designed correctly the submit control would designate the action= attribute, not the form tag.
0
frugalmuleAuthor Commented:
Thank you all for your detailed help.  I am looking for something a little different I think.  Here is a visual on my environment and what I am trying to accomplish on it http://screencast.com/t/SUvvBjuanF9
0
Dave BaldwinFixer of ProblemsCommented:
What you're asking for is actually far more complicated than what we've posted here because it has to work inside an already complicated database driven application, Wordpress.  If you can find a plugin that someone else has already written, you might be able to do what you want with the extra field.  The program you're using, phpMyAdmin, does the things we've been talking about but in a much more complicated way to handle all the details that you encounter when trying to admin a database server.
0
Ray PaseurCommented:
OK, I've watched the screencast.  Are you suggesting that you want to give others the ability to run phpMyAdmin on your database?  I might not want to do that.  What if the password "got loose" somehow?  All of your data is exposed there.
0
PortletPaulfreelancerCommented:
>>"that's all I want to do"      "nothing more complicated that that"

those are classic quotes frugalmule,
that seriously underestimate just how much effort has gone into the various parts of what you used for that screencast.

PHP & MySQL & phpMyAdmin & Wordpress
(keep adding ... the web server, Linux probably, that screencast program, this forum ...)

It all represents 000,000's of lines of code, goodness know how many hours of effort by goodness knows how many volunteers
- yet you see it as simple, click here, done.
------------------

I think your best bet is to follow that abase add-in, e.g.
How do I create a form to update a record in a table?

First you need a way to identify the record you want to update. To do so, we can use the rlink attribute to specify the first name as a "record" link.

[abase table="employees" columns="first_name,last_name" rlink="first_name" echo="blue"]

The first name will appear as a link. Clicking on a link first name will re-display the page with the primary key and value in the query string. To create the form, place the following shortcode on the same page.

[abase form="1,update" table="employees" elements="first_name,last_name" fields="first_name,last_name$Update Employee" ack="brown" echo="blue"]

When a record identified by its primary key is in the query string, an update form for that record will be produced.
http://abase.com/

The abase addin comes with documentation
What are all these attributes? Where's a ABASE reference guide?

From the Details screen before you install ABASE, complete shortcode and attribute documentation can be found in the Description section. Once installed, from the WordPress Admin section, click Settings on the left, and then "ABASE for MySQL." This is also where you set the database and user. Below that is the most up-to-date reference guide for ABASE.
So my suggestion would be to read that documentation and then use the plugin.

btw:
there's 2,306 lines of php code in abase 2.1.8
& multiply by the numbers of versions
0.1 .... 1.0 .... 2.0 ... 2.1.8

someone has put in quite some effort to make it simple for you.

Caveats:

I don't use Wordpress and have never seen/heard of abase before
- so I have no idea how robust or secure it is.
0
frugalmuleAuthor Commented:
Me either but it looks like an already developed way to at least 'display' what I want. Here is the website http://abase.com/.  Perhaps display all I need but there does seem to be some interesting functionality, then I could let someone make edits to the page which I could then migrate into the database.  after verifying it is entered correctly.
0
Ray PaseurCommented:
I've seen WP hacked and databases destroyed a great many times.   A lot of times, the plight of the victims makes its way into EE, so it's kind of inescapable because they often post the question in the PHP Zone (because WP is written in PHP).  

WordPress itself is almost never the problem.  Perhaps a release or two makes it out with a security hole, but it's rare.  What is common and problematic are the plug-ins.  If you do not understand every line of the PHP code in a plug-in, and you install the plug-in, you're at risk.  And there is nobody looking out for you; you are the attacker's lawful prey.  In fact, there may even be someone who has a bridge they want to sell you!  

If I had an evil intent and wanted to be able to target millions of web sites, I would just write an interesting-looking WP plug-in that had a backdoor.  Or to put it in the words of the great oil well fire fighter Red Adair, "If you think it's expensive to hire a professional, just wait till you hire an amateur!"

Best of luck with your project, ~Ray
0
frugalmuleAuthor Commented:
I understand your concerns.  Thank you for chiming in.
0
Ray PaseurCommented:
Here is a link to the finished article.  Let me know if you find any typos, and I'll fix them.  Thanks, ~Ray
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_12335-PHP-and-MySQLi-Table-Maintenance.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.