Adsense

zGrid : PHP / AJAX / jQuery based Grid System

I found a Grid system using PHP, jQuery and Ajax. I want to share this with my dear users. It is not very well parametrized or generic but if have little much understanding of jQuery and Ajax then its easy to use. Give your feed back about zGrid.


Direct Link


Demo

Exporting data from MS Access 2003 to MySQL


Most businesses use a software mix in their IT arsenal that makes business sense to them. Because of this, often they have to migrate a part, or whole of their data from one software program to another. In this article by Dr. Jay Krishnaswamy, the built-in method of exporting tables in Microsoft Access is explored to take a table in Microsoft over to MySQL, the open source database product that changed hands recently. This article steps you through the process with a number of screen shots to guide you along the way.

Introduction

It is assumed that you have a working copy of MySQL which you can use to work with this article. The MySQL version used in this article came with the XAMPP download. XAMPP is an easy to install (and use) Apache distribution containing MySQL, PHP, and Perl. The distribution used in this article is XAMPP for Windows. You can find documentation here. Here is a screen shot of the XAMPP control panel where you can turn the services on and off and carry out other administrative tasks.


You need to follow the steps indicated here:
  1. Create a database in MySQL to which you will export a table from Microsoft Access 2003
  2. Create a ODBC DSN that helps you connecting Microsoft Access to MySQL
  3. Export the table or tables
  4. Verify the exported items

Creating a database in MySQL

You can create a database in MySQL by using the command 'Create Database' in MySQL or using a suitable graphic user interface such as MySQL workbench. You will have to refer to documentation that works with your version of MySQL. Herein the following version was used. The next listing shows how a database named TestMove was created in MySQL starting from the bin folder of the MySQL program folder. Follow the commands and the response from the computer. The Listing 1 and the folders are appropriate for my computer and you may find it in your installation directory. The databases you will be seeing will be different from what you see here except for those created by the installation.

Listing 1: Login and create a database

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:Documents and SettingsJayaram Krishnaswamy>cd

C:>cd xamppmysqlbin

C:xamppmysqlbin>mysql -h localhost -u root -p
Enter password: *********
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.1.30-community MySQL Community Server (GPL)

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cdcol |
| expacc |
| mengerie |
| mydb |
| mysql |
| phpmyadmin |
| test |
| testdemo |
| webauth |
+--------------------+
10 rows in set (0.23 sec)

mysql> create database TestMove;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cdcol |
| expacc |
| mengerie |
| mydb |
| mysql |
| phpmyadmin |
| test |
| testdemo |
| testmove |
| webauth |
+--------------------+
11 rows in set (0.00 sec)

mysql>
The login detail that works error free is shown. The preference for host name is localhost v/s either the Machine Name (in this case Hodentek2) or the IP address. The first 'Show Databases' command does not display the TestMove we created which you can see in response to the 2nd Show Databases command. In windows the commands are not case sensitive.

Creating an ODBC DSN to connect to MySQL

When you install from XAMPP you will also be installing an ODBC driver for MySQL for the version of MySQL included in the bundle. In the MySQL version used for this article the version is MySQL ODBC5.1and the file name is MyODBC5.dll.
Click Start | Control Panel | Administrative Tools | Data Sources (ODBC) and open the ODBC Data Source Administrator window as shown. The default tab is User DSN. Change to System DSN as shown here.
Click the Add... button to open the Create New Data Source window as shown.
Scroll down and choose MySQL ODBC 5.1 Driver as the driver and click Finish. The MySQL Connector/ODBC Data Source Configuration window shows up.


You will have to provide a Data Source Name (DSN) and a description. The server is the localhost. You must have your User Name/Password information to proceed further. The database is the name of the database you created earlier (TestMove) and this should show up in the drop-down list if the rest of the information is correct. Accept the default port. If all information is correct the Test button gets enabled.
Click and test the connection using the Test button. You should get a response as shown.


Click the OK button on the Test Result window. Click OK on the MySQL Connector/ODBC Data Source Configuration window. There are a number of other flags that you can set up using the 'Details' button. The defaults are acceptable for this article.
You have successfully created a System DSN 'AccMySQL' as shown in the next window. Click OK.

Verify the contents of TestMove

The TestMove is a new database created in MySQL and as such it is empty as you verify in the following listing.

Listing 2: Database TestMove is empty

mysql> use testmove;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql>

Export the Employees table from MS Access to TestMove

Open the Northwind.mdb (or any other mdb file) file as shown in the next figure.


Highlight the Employees table and make a right click to bring up a drop-down menu as shown.
Exporting data from MS Access 2003 to MySQL
Click on Export to open the Export Table 'Employees' To... window. Click on the Save as type drop-down to reveal the various file types that you can export to as shown.
Exporting data from MS Access 2003 to MySQL
Click on ODBC Sources the Export window pops-up as shown.
Exporting data from MS Access 2003 to MySQL
Click OK. This opens the Select Data Source window. Click on the Machine Data Source tab to show the various available DSN's. You will notice the AccMySQL created earlier.
Exporting data from MS Access 2003 to MySQL
Choose AccMySql and click OK. The program returns you to MS Access's Northwind database without giving you an indication about the success/failure of the export. If there is an error it however gives a error message.

Verifying and accessing exported table

Now go back to the DOS screen. I assume you have not closed down the mysql > prompt. Enter commands as shown in the listing.
mysql> use testmove
Database changed
mysql> show tables;
+--------------------+
| Tables_in_testmove |
+--------------------+
| employees |
+--------------------+
1 row in set (0.00 sec)

mysql>
Now you can see that the Employees table has entered the TestMove database in MySql. Probe a little further by entering a select statement to see how much of the data has come in.
mysql> use testmove
Database changed
mysql> show tables;
+--------------------+
| Tables_in_testmove |
+--------------------+
| employees |
+--------------------+
1 row in set (0.00 sec)

mysql> Select * from Employees;
+------------+-----------+-----------+------------------------ 
--------------+---------------------+------------------------- 
-------------------------------------------------------------- 
----------------------------------------+-----------+
| EmployeeID | LastName | FirstName | Title 
| TitleOfCourtesy | BirthD
ate | HireDate | Address 
| City | Region |
PostalCode | Country | HomePhone | Extension | Photo 
| Notes | ReportsTo |
+------------+-----------+-----------+------------------------ 
--------------+---------------------+------------------------- 
-------------------------------------------------------------- 
----------------------------------------+-----------+
| 1 | Davolio | Nancy | Sales Representative 
| Ms. | 1968-1
2-08 00:00:00 | 1992-05-01 00:00:00 | 507 - 20th Ave. E.
Apt. 2A | Seattle | WA | 98122 | USA | (206) 
555-9857 | 5467 | EmpID
1.bmp | Education includes a BA in psychology from Colorado 
State University. She also co
mpleted "The Art of the Cold Call." Nancy is a member of 
Toastmasters International.| 2 |

| 2 | Fuller | Andrew | Vice President, Sales 
| Dr. | 1952-0
2-19 00:00:00 | 1992-08-14 00:00:00 | 908 W. Capital Way 
| Tacoma | WA |
98401 | USA | (206) 555-9482 | 3457 | 
EmpID2.bmp | Andrew received his BTS
commercial and a Ph.D. in international marketing from the University
of Dallas. He is fluent in French and Italian and reads German. 
He joined the company as a sales representative, was promoted to 
sales manager and was then named vice president of sales. 
Andrew is a member of the Sales Management Roundtable, 
the Seattle Chamber of Commerce, and the Pacific Rim Importers 
Association. | NULL |

| 3 | Buchanan | Steven | Sales Manager 
| Mr. | 1955-0
3-04 00:00:00 | 1993-10-17 00:00:00 | 14 Garrett Hill 
| London | NULL |
SW1 8JR | UK | (71) 555-4848 | 3453 | 
EmpID5.bmp | Steven Buchanan graduate
d from St. Andrews University, Scotland, with a BSC degree. 
Upon joining the company as a sales representative, he spent 
6 months in an orientation program at the Seattle office a
nd then returned to his permanent post in London, where he was 
promoted to sales manager. Mr. Buchanan has completed the 
courses "Successful Telemarketing" and "International Sale
s Management." He is fluent in French. | 2 |

| 4 | Suyama | Michael | Sales Representative 
| Mr. | 1963-0
7-02 00:00:00 | 1993-10-17 00:00:00 | Coventry House
Miner Rd. | London | NULL | EC2 7JR | UK | 
(71) 555-7773 | 428 | E
mpID6.bmp | Michael is a graduate of Sussex University (MA, 
economics) and the University of California at Los Angeles 
(MBA, marketing). He has also taken the courses "Multi-Cultural
Selling" and "Time Management for the Sales Professional." 
He is fluent in Japanese and can read and write French, 
Portuguese, and Spanish.| 3 |

+------------+-----------+-----------+------------------------ 
--------------+---------------------+------------------------- 
-------------------------------------------------------------- 
----------------------------------------+-----------+
4 rows in set (0.00 sec)

mysql>
The output is not particularly pretty but you can see that the data has come in. The next figure shows the same query run in MySQL Workbench a graphic tool used in querying and modeling MySql databases.
Exporting data from MS Access 2003 to MySQL

Summary

The article described the procedure to create an ODBC DSN for connecting to a MySQL Database. The article also described the process of copying data in an MS Access database to MySQL.



Popular Extensions for Drupal Theme Designing


1. ADMINISTRATION MENU:
In Drupal 7, the administration menu toolbar has all the options of the default toolbar and besides this, it also exposes all the menu options without having to navigate through sub menus.
2. COLOR BOX:
with this module, you can easily create light boxes for images, forms, and content. It also supports the most commonly requested features like captions, slideshows etc.
3. DEVEL:
It is a collection of useful tools and various utilities. It has options like print arrays, print summaries of DB queries, log performance, summaries of node access etc.
4. CHAOS TOOL SUIT:
This module is helpful to developers and is a collection of APIs and tools. It has many helpful features for developers like Form wizard, dependent widget etc. I
5. CONDITIONAL STYLESHEETS:
With this module, themers can work on the issue of cross browser compatibility with Internet Explorer. It lets you to add stylesheets and target  the browser via .info file.
6. FRONTPAGE:
This module helps you to designate different front pages for anonymous as well as authenticated users. This module eliminates the need of code and hence anyone can set this up.
7. @FONT-YOUR-FACE:
This module provides an admin interface to  browse and apply web fonts to Drupal themes. The fonts are automatically loaded from selected sources and can be applied to the styles.
8. .MOBILOADER:
This module works with .mobi theme which is a special theme designed for mobile devices. This module can automatically detects and overrides the default theme with .mobi theme.
9. HTML5 TOOLS:
This module is in development phase. It will help in developing Drupal sites designing HTML5. It has multiple tools.
10. NICE MENUS:
This module provides you with an easy drop-down menu solution. It has multiple menus that can be styled by overriding the default selectors.
11. MOBILE THEME:
This module helps in switching themes. It lets administrators to designate theme to be used with mobile devices.
12. NOGGIN:
This module allows you to add a custom header image to default Drupal themes. By controlling from the page, you can add the header image to any of the default themes.
13. ORGANIC GROUPS:
With this module, you can allow users to create as well as manage their own groups. It is quite powerful and is a popular module with many options.
14. SEMANTIC VIEWS:
This module extends the functionality of Views. It simplifies the theming of views by making it easier to insert HTML markup for your Views rows and fields.
15. SWEAVER:
By using this module, you can make your themes editable by anyone. This provides an easy to use interface to the users to change their theme without making the use of CSS.
16. SKINR:
With the help of this module, a themer can define a set of reusable CSS styles. To make themes Skinr compatible, you need to modify them a bit.
17. STYLE GUIDE:
This module produces a visual reference page which helps you to check the styling for the theme. It saves a lot of time and helps you to do things quickly.
18. THEME KEYS:
This is another theme switcher that allows you to run multiple themes and automatically switch between them.
19. VIEWS:
With this module, you can enhance your controls over the listing of content items and you can also create custom lists.
20. PANELS:
This module lets you divide a page into various content areas and gives you control over content in each area.

Get URL, URL part, URL parameters using javascript



Getting URL or URL parts through javascript is so easy. We can get protocal using this code :
  1. var proto    = window.location.protocol;  
  2. alert( proto );  
this code return "http:" protocol.
If you want to get host name from the URL using javascript then you can simple write this code:

  1. var hostName = window.location.host;  
  2. alert( hostName );  
this code return the host name like if you are running this code in local host then it returns "localhost"
if you want to get path of the URL with javascript then use this:

  1. var pathName = window.location.pathname;  
  2. alert( pathName );  
this code returns the path name of the current running script like you are running the script in test.html the it return the full path name with filename test.html
Or if you want to get parameter used in URL with javascript then simply do this:

  1. var params   = window.location.search;  
  2. alert( params );  
it returns the parameter used in the URL

now lets join all the code :

  1. var proto    = window.location.protocol;  
  2. var hostName = window.location.host;  
  3. var pathName = window.location.pathname;  
  4. var params   = window.location.search;  
  5.   
  6. alert( proto + hostName + pathName + params );  

newest questions on wordpress