Table of Contents for
Mastering phpMyAdmin 3.4 for Effective MySQL Management

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Mastering phpMyAdmin 3.4 for Effective MySQL Management by Marc Delisle Published by Packt Publishing, 2012
  1. Cover
  2. Mastering phpMyAdmin 3.4 for Effective MySQL Management
  3. Mastering phpMyAdmin 3.4 for Effective MySQL Management
  4. Credits
  5. About the Author
  6. About the Reviewers
  7. www.PacktPub.com
  8. Preface
  9. What you need for this book
  10. Who this book is for
  11. Conventions
  12. Reader feedback
  13. Customer support
  14. 1. Getting Started with phpMyAdmin
  15. What is phpMyAdmin?
  16. Installing phpMyAdmin
  17. Configuring phpMyAdmin
  18. Installing phpMyAdmin configuration storage
  19. Upgrading phpMyAdmin
  20. Summary
  21. 2. Configuring Authentication and Security
  22. Securing phpMyAdmin
  23. Summary
  24. 3. Over Viewing the Interface
  25. Customizing general settings
  26. Character sets and collations
  27. Navigation panel
  28. Main panel
  29. User preferences
  30. Query window
  31. Summary
  32. 4. Creating and Browsing Tables
  33. Creating our first table
  34. Inserting data manually
  35. Browse mode
  36. Profiling queries
  37. Creating an additional table
  38. Summary
  39. 5. Changing Data and Structure
  40. Changing table structure
  41. Summary
  42. 6. Exporting Structure and Data (Backup)
  43. Exporting a database
  44. Exporting a table
  45. Exporting selectively
  46. Exporting multiple databases
  47. Saving the export file on the server
  48. Memory limits
  49. Summary
  50. 7. Importing Structure and Data
  51. Importing SQL files
  52. Importing CSV files
  53. Importing other formats
  54. Reading files from a web server upload directory
  55. Displaying an upload progress bar
  56. Summary
  57. 8. Searching Data
  58. Performing a complete database search
  59. Stopping an errant query
  60. Summary
  61. 9. Performing Table and Database Operations
  62. Changing table attributes
  63. Emptying or deleting a table
  64. Renaming, moving, and copying tables
  65. Performing other table operations
  66. Multi-table operations
  67. Database operations
  68. Summary
  69. 10. Benefiting from the Relational System
  70. Defining relations with the relation view
  71. Defining relations with the Designer
  72. Benefiting from the defined relations
  73. Column commenting
  74. Summary
  75. 11. Entering SQL Statements
  76. The Query window
  77. Multi-statement queries
  78. Pretty printing (syntax highlighting)
  79. The SQL Validator
  80. Summary
  81. 12. Generating Multi-table Queries
  82. Exploring column criteria
  83. Generating automatic joins (internal relations)
  84. Executing the query
  85. The visual builder
  86. Summary
  87. 13. Synchronizing Data and Supporting Replication
  88. Supporting MySQL replication
  89. Summary
  90. 14. Using Query Bookmarks
  91. Creating bookmarks
  92. Recalling bookmarks from the bookmarks list
  93. Passing a parameter to a bookmark
  94. Summary
  95. 15. Documenting the System
  96. Generating relational schemas
  97. Summary
  98. 16. Transforming Data using MIME
  99. Enabling transformations
  100. Examples of transformations
  101. Summary
  102. 17. Supporting Features Added in MySQL 5
  103. Supporting routines—stored procedures and functions
  104. Executing code with triggers
  105. Using information_schema
  106. Partitioning
  107. Exploring the event scheduler
  108. Summary
  109. 18. Tracking Changes
  110. Prerequisites
  111. Principles
  112. Initiating tracking for one table
  113. Testing the tracking mechanism
  114. Determining tracking status
  115. Structure snapshot
  116. Exporting a version
  117. Creating a new version
  118. Deleting tracking information
  119. Summary
  120. 19. Administrating the MySQL Server
  121. Database information
  122. Server information
  123. Summary
  124. A. Troubleshooting and Support
  125. Seeking support
  126. Contributing to the project

Exploring column criteria

Three criteria columns are provided by default. This section discusses the options we have for editing their criteria. These include options for selecting columns, sorting individual columns, entering conditions for individual columns, and so on.

Column selector: Single column or all columns

The Column selector contains all the individual columns for the selected tables, plus a special choice ending with an asterisk (*) for each table, which means that all the columns are selected.

Column selector: Single column or all columns

To display all the columns in the author table, we would choose `author`.* and check the Show checkbox, without entering anything in the Sort and the Criteria boxes. In our case, we select `author`.`name`, as we want to enter some criteria for the author's name.

Sorting columns

For each selected individual column, we can specify a sort (in Ascending or Descending order), or let this line remain intact (no sorting, which is the default behavior). If we choose more than one sorted column, the sorting will be carried out from left to right.

Note

When we ask for a column to be sorted, we normally check the Show checkbox. But this is not necessary, as we might want to do just the sorting operation without displaying this column.

Showing a column

We check the Show checkbox so that we can see the column in the results. Sometimes, we may just want to apply a criterion on a column, and not include it in the resulting page. Here, we add the phone column, ask for it to be sorted, and choose to show both the name and the phone number. We also ask for a sort on the name in the ascending order. The sort will be done first by name, and then by the phone number if the names are identical. This is because the name is in a column criterion to the left of the phone column, and thus has a higher priority.

Showing a column

Updating the query

At any point, we can click on the Update Query button to see the progress of our generated query. We have to click it at least once before executing the query. For now, let us click it and see the query generated in the query area. In the following examples, we will click on the Update Query button after each modification.

Updating the query

We have selected two tables, but have not yet chosen any column from the book table. Hence, this table is not mentioned in the generated query.

Adding conditions to the criteria box

In the Criteria box, we can enter a condition (respecting the SQL WHERE clause's syntax) for each of the corresponding columns. By default, we have two criteria rows. To find all the authors with Smith in their names, we use a LIKE criterion (LIKE '%SMITH%') and click on Update Query.

Adding conditions to the criteria box

We have another line available to enter an additional criterion. Let us say we want to find the author Maria Sunshine as well. This time, we use an = condition. The two condition rows will be joined by the Or operator, selected by default from the left side of the interface.

Adding conditions to the criteria box

To better demonstrate that the Or operator links both the criteria rows, let us now add a condition, LIKE '%8%', on the phone number as shown in the following screenshot:

Adding conditions to the criteria box

By examining the positioning of the AND and OR operators, we can see that the first row of the conditions is linked by the AND (because AND is chosen under the name column) operator, and the second row of conditions is linked to the rest by the OR operator. The condition that we have just added ' (LIKE %8%') is not meant to find anyone, because we changed the phone number of all the authors with the name "Smith" to "444-5555" (in Chapter 11).

If we want another criterion on the same column, we just add a criteria row.

Adjusting the number of criteria rows

The number of criteria rows can be changed in two ways. First, we can select the Ins checkbox under Criteria to add one criteria row (after clicking on Update Query). As this checkbox can add only one criteria row at a time, we will uncheck it and use the Add/Delete criteria rows dialog instead. In this dialog, we choose to add two rows.

Another click on the Update Query button produces the following screen:

Adjusting the number of criteria rows

Now, you can see that there are two additional criteria rows (which are empty at the moment). We can also remove criteria rows. This can be done by ticking the Del checkbox beside the row(s) we want to remove. Let us remove the two rows we have just added, as we don't need them now. The Update Query button refreshes the page with the specified adjustment.

Adjusting the number of criteria columns

Using a similar mechanism, we can add or delete columns by checking the Ins or Del checkboxes under each column in the Modify dialog, or the Add/Delete columns dialog. We already had one unused column (not shown on the previous images). Here, we have added one column using the Ins checkbox located under the unused column (this time, we will need it):

Adjusting the number of criteria columns