Home arrow PHP arrow Page 2 - Changing Table Structure in phpMyAdmin

Editing Field Attributes - PHP

This chapter explores editing table definitions and using special column types. When developing Web applications (or any application), requirements often change because of new or modified needs. Developers must accommodate these changes through judicious table-structure editing. This is chapter six of Mastering phpMyAdmin for Effective MySQL Management by Marc Delisle (Packt Publishing, April 2004, ISBN 1904811035).

TABLE OF CONTENTS:
  1. Changing Table Structure in phpMyAdmin
  2. Editing Field Attributes
  3. BLOB (Binary Large Object)
  4. ENUM and SET
  5. Index Management
  6. Multi-Field Indexes and Index Editing
  7. Table Optimization: EXPLAIN a Query
By: Marc Delisle
Rating: starstarstarstarstar / 21
September 28, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

On the Structure sub-page, we can make further changes to our table. For this example, we have set $cfg['PropertiesIconic'] to 'both' to see both the icons along with their text explanation:

phpMyAdmin

This panel does not allow every possible change to fields. It specifically allows:

  • Changing one field structure, using the Change link on a specific field
  • Removing a field: Drop
  • Adding a field to an existing Primary key
  • Setting a non-unique Index or a Unique index on a field
  • Setting a Fulltext index (offered only if the field type allows it)

These are quick links that may be useful in specific situations. Keep in mind that they do not replace the full index management panel, or the full field structure panel. Both are explained in this chapter.

We can also use the checkboxes to choose fields, and with the appropriate With selected icons, Edit the fields or do a multiple field deletion with Drop. The Check All / Uncheck All option permits us to easily check or uncheck all boxes.

TEXT Fields

We will now explore how to use the TEXT field type and the relevant configuration values to adjust for the best possible phpMyAdmin behavior.

First we add a TEXT field called description:

phpMyAdmin

There are three parameters that control the layout of the text area that will be displayed in Insert or Edit mode for the TEXT fields.

First, the number of columns and rows for each field is defined by:

$cfg['TextareaCols'] = 40;
$cfg['TextareaRows'] = 7;

This gives (by default) the following space to work on a TEXT field:

phpMyAdmin

The settings do not impose a limit other than visual, and a vertical scroll bar is created by the browser, should it be necessary.


Although MEDIUMTEXT, TEXT, and LONGTEXT columns can accommodate more than 32K of data, current browsers cannot always edit them with the mechanism offered by HTML: a text area. In fact, experimentation has convinced the phpMyAdmin development team to have the product display a warning message if the contents are larger than 32K, telling users that it might not be editable.

For LONGTEXT fields, setting $cfg['LongtextDoubleTextarea'] to TRUE doubles the available editing space.

phpMyAdminThis chapter is from Mastering phpMyAdmin for Effective MySQL Management by Marc Delisle (Packt Publishing, April 2004, ISBN 1904811035). Check it out at your favorite bookstore today.

Buy this book now.



 
 
>>> More PHP Articles          >>> More By Marc Delisle
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: