Export MySQL To Excel Using PHP

Inserting data to your database and getting all the data when required is a much needed operation in websites maintenance or development. So making all these operations easy is really needy.

I am presenting you a PHP script to export mysql to excel sheet and download. Script is orginally written by Oliver Schwarz <oliver.schwarz@vaicon.de>

Following are the script to call the class file and produce the output. Just download the php file and class file and follow the following steps,

1 : Create Download Link

<a href=”export.php”>Export To Excel</a>

2 : Include the .class file to “php-excel.php”

// load library
require ‘php-excel.class.php’;

3 : Include db file for database connection

// load your db file for databse connection
require ‘php-db-connect.php’;

4 : Set your column names for excel file

5 : Create loop to fetch data and write to excel file

6 : Create Excel File & Export MySQL to Excel

Its so easy and handy to use. Download Export-To-Excel.zip

Live URL Of jQuery UI Themes

jQuery UI is a JavaScript library that provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript library, that can be used to build interactive web applications.

You need to add the jQuery.ui.js file to enable your UI integration. And for the styles you need to include ui.css files. Switching with the themes is little difficult you you are downloading the files from the jQuery.ui site and including it to your html page.

A more easy way is there to play with all the themes provided by jQuery.ui without downloading all of them. Below are the live urls of the ui.css files for all the themes. Just put these urls in your scripting include and the ui theme for whole site will be changed and you can see the reflection at that instance.

Script to include your JS files to enable jQuery and jQuery UI Themes for your site,

<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js”></script>

<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js”></script>

Now add you css file for UI CSS. The url should be chnaged to change the UI theme,

<link rel=”stylesheet” type=”text/css” href=”DYNAMIC URL HERE” media=”screen” />

Now find below your desired theme and place that URL into the above code.

BASE

http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css

BLACK-TIE

http://code.jquery.com/ui/1.9.1/themes/black-tie/jquery-ui.css

BLITZER

http://code.jquery.com/ui/1.9.1/themes/blitzer/jquery-ui.css

CUPERTINO

http://code.jquery.com/ui/1.9.1/themes/cupertino/jquery-ui.css

DARK-HIVE

http://code.jquery.com/ui/1.9.1/themes/dark-hive/jquery-ui.css

DOT-LUV

http://code.jquery.com/ui/1.9.1/themes/dot-luv/jquery-ui.css

EGGPLANT

http://code.jquery.com/ui/1.9.1/themes/eggplant/jquery-ui.css

EXCITE-BIKE

http://code.jquery.com/ui/1.9.1/themes/excite-bike/jquery-ui.css

FLICK

http://code.jquery.com/ui/1.9.1/themes/flick/jquery-ui.css

HOT-SNEAKS

http://code.jquery.com/ui/1.9.1/themes/hot-sneaks/jquery-ui.css

HUMANITY

http://code.jquery.com/ui/1.9.1/themes/humanity/jquery-ui.css

LE-FROG

http://code.jquery.com/ui/1.9.1/themes/le-frog/jquery-ui.css

MINT-CHOC

http://code.jquery.com/ui/1.9.1/themes/mint-choc/jquery-ui.css

OVERCAST

http://code.jquery.com/ui/1.9.1/themes/overcast/jquery-ui.css

PEEPPER-GRINDER

http://code.jquery.com/ui/1.9.1/themes/pepper-grinder/jquery-ui.css

REDMOND

http://code.jquery.com/ui/1.9.1/themes/redmond/jquery-ui.css

SMOOTHNESS

http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css

SOUTH-STREET

http://code.jquery.com/ui/1.9.1/themes/south-street/jquery-ui.css

START

http://code.jquery.com/ui/1.9.1/themes/start/jquery-ui.css

SUNNY

http://code.jquery.com/ui/1.9.1/themes/sunny/jquery-ui.css

SWANKY-PURSE

http://code.jquery.com/ui/1.9.1/themes/swanky-purse/jquery-ui.css

TRONSTATIC

http://code.jquery.com/ui/1.9.1/themes/trontastic/jquery-ui.css

UI-DARKNESS

http://code.jquery.com/ui/1.9.1/themes/ui-darkness/jquery-ui.css

UI-LIGHTNESS

http://code.jquery.com/ui/1.9.1/themes/ui-lightness/jquery-ui.css

VADER

http://code.jquery.com/ui/1.9.1/themes/vader/jquery-ui.css

 

All the css can be managed in the database also and you can have a nice UI theme chnager option for your site. I hope this post will help will somewhat.

Hide Files & Folders Using Command Prompt

You always wanted to hide your personal and confidential data from unknown or strangers eyes but using any software may charge you, here is a trick from which you can easily hide your content.

The most important thing is that, once hidden with this method, the files/folders cannot be viewed by any search options even if you click “Show All Hidden Files and Folders”.

You can now easily hide your files or folders through Command Prompt. It will be impossible for others to find the file or folder unless they know the file name or folder name. You can secure your documents easily by this method. Make sure you remember the file or folder name!

Hiding the most wanted files and folders is very important nowadays and it’s really a tedious job too. In order to make this tedious job an easy one, I’m going to deliver you this trick now.

Step 1 : Open Command Prompt

Hit Windows + R key on keyboard to enter into “RUN” mode.

open_cmd

Type “cmd” and hit Enter. 

cmd

Step 2 : Navigate To Desired Drive And Hide Item

In my case my folder “Private” is present inside E:

my_folder

Now switch to command prompt and type “E:” and Hit Enter. You are now in E drive.

hide_folder

Here is your original command,

attrib +s +h Private

Otherwise you can directly enter the following command without switching to the drive E in following way,

attrib +s +h E:Private

step 3 : Unhide Your Item

In this trick you have to remember your folder or file name in order unhide, because you can not even find the item after you choose “Display Hidden Files And Folders”. Type the same code with (-) symbol.

attrib -s -h E:Private

Step 4 : Find Your Item In Emergency

Create a “sample.zip” file in you drive and navigate to that folder to view all the hidden files applied through the command prompt,

I hope this trick will somewhat useful for you.