PHP
  Home arrow PHP arrow Page 5 - Doing More with phpMyAdmin (Part 2)
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Doing More with phpMyAdmin (Part 2)
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 39
    2003-12-08

    Table of Contents:
  • Doing More with phpMyAdmin (Part 2)
  • The Ground Work
  • Total Recall
  • Tangled Relationships
  • Bookmark Bandit
  • Looking Up the Dictionary
  • History Lesson

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Doing More with phpMyAdmin (Part 2) - Bookmark Bandit


    (Page 5 of 7 )

    Just as most browsers allow users to bookmark favorite Web sites, phpMyAdmin allows developers to bookmark complex queries, so that they can be easily reused over and over again. As an example, consider the following query, which returns a list of customers along with the services that they have opted for:

    SELECT clients.cname, services.sname 
    FROM branches, clients, branches_services, services 
    WHERE branches.bid = branches_services.bid 
    AND clients.cid = branches.cid 
    AND branches_services.sid = services.sid
    


    This query can easily be bookmarked by popping open the Query window (bottom left of the application) and entering the query above into the query box. Once a result set appears, simply scroll to the bottom of the results page, enter a name for the bookmark, and click the Bookmark this SQL-Query button to save the query to the bookmarks file.

    When you need to execute the query again, use the SQL tab to obtain a drop-down list of all previously-bookmarked queries. Find the query you bookmarked earlier, select it and Bob's your uncle!

    You can also use variables in such bookmarked queries. For example, if you want to specify the sid of the service in the query on a per-instance basis, simply alter the query string to look like this:

    SELECT clients.cname, services.sname 
    FROM branches, clients, branches_services, services 
    WHERE branches.bid = branches_services.bid 
    AND clients.cid = branches.cid 
    AND branches_services.sid = services.sid /* 
    AND services.sid = [VARIABLE] */ 
    


    Now, run the query. The first time around, phpMyAdmin will ignore the condition between the "/*" and "*/" comment marks and run the query after discounting that section of the query string. No matter; when the result set appears, bookmark this query and then use the SQL tab to run it again. This time, you'll be asked for a value for the sid variable, as seen here.

    While this is a good feature, be warned that it is still a little buggy: I could not use it with string variables correctly and, while it certainly offers a great way to store complex queries for reuse, it still needs some tweaking.

    More PHP Articles
    More By Harish Kamath, (c) Melonfire


       · enjoyed the article, even though it's pretty old. the links to all pictures are...
     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT