Archive

August 2015

Browsing

Export excel from mysql table data using php code

Every one know to export MySQL table data as excel sheet from the back end in server.

Export excel from mysql table data using php code

But we are going to learn Export excel from mysql table data using php code.

Step 1:
create index.php file
simple form action

<style>
.btn {
  background: #3498db;
  background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
  background-image: -moz-linear-gradient(top, #3498db, #2980b9);
  background-image: -ms-linear-gradient(top, #3498db, #2980b9);
  background-image: -o-linear-gradient(top, #3498db, #2980b9);
  background-image: linear-gradient(to bottom, #3498db, #2980b9);
  -webkit-border-radius: 28;
  -moz-border-radius: 28;
  border-radius: 28px;
  font-family: Arial;
  color: #ffffff;
  font-size: 20px;
  padding: 10px 20px 10px 20px;
  text-decoration: none;
}
</style>

<form action="export.php" method="post" name="export_excel">
<button type="submit" id="export" name="export" class="btn btn-primary button-loading" data-loading-text="Loading...">Export CSV/Excel File</button>
			
</form>

step 2: Create export.php file for action. All the code and actions comes under this file

<?php
include 'config.php';    // database configuration
$SQL = "SELECT  * from data";   // select table

$header = '';
$result ='';
$exportTable = mysql_query ($SQL ) or die ( "Sql error : " . mysql_error( ) );  // export query
 
$rows = mysql_num_fields ( $exportTable );    // select all fields from the table
 
for ( $i = 0; $i < $rows; $i++ )       // check all the fields using for loop 
{
    $header .= mysql_field_name( $exportTable , $i ) . "\t";
}
 
while( $row = mysql_fetch_row( $exportTable ) )     // fetching all rows from the tables
{
    $line = '';
    foreach( $row as $value )
    {                                            
        if ( ( !isset( $value ) ) || ( $value == "" ) )
        {
            $value = "\t";
        }
        else
        {
            $value = str_replace( '"' , '""' , $value );
            $value = '"' . $value . '"' . "\t";
        }
        $line .= $value;
    }
    $result .= trim( $line ) . "\n";
}
$result = str_replace( "\r" , "" , $result );
 
if ( $result == "" )
{
    $result = "\nNo Record(s) Found!\n";                        
}
 
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=export.xls");
header("Pragma: no-cache");
header("Expires: 0");
print "$header\n$result";
 
?>

Step 3: create config.php for database configuration

<?php
$con = mysql_connect('localhost','root','');
mysql_select_db('your_database_name',$con)
?>

Result files export with excel sheet
Export excel from mysql table data using php
yes some of you thought that y should i use this code, just we can try it from back end right, you are right this is for single mysql table for export

But for multi table mysql export using joins or unions, This code is used for this kind of purpose

check this two mysql tablesExport excel from mysql table data php code

Export excel from mysql table data php
How to export multi table data with single excel sheet, Simple replace this

$SQL = "SELECT  * from data";  // change this code
$SQL = "SELECT data.id, data.data, data.weight, products.qid, products.serial, products.name, products.description FROM `data` AS data INNER JOIN `products` AS products ON data.id = products.serial";

Then the result will be
Export excel from mysql table data
Thats it enjoy the code   download code here

 

WhatsApp updates can customize you notifications for your favorite contacts

WhatsApp has update some of useful features to the android users today. This updates give user can manually customize their contact notification and mentioned their favorite contacts.

This features can make your chat easier to mark or ignore so this wont affect message read status or received status in your conversation.

Open up a conversation and tap View Contact, and you’ll spot new options for custom notifications. There are settings for vibration alerts, lights, pop-ups and audio tones.Whatsapp updates

The ability to toggle the read status of chats showed up in an earlier buildlast month, but it’s here for all users now. Long-press on a conversation in the Chats list to mark it as read or unread.

Set-notifications-for-each-contact

You can also mute conversations with individual contacts for preset periods, just like with group chats — though you’d probably have to be rather rude to do that!

Additionally, the latest version also brings an option in the Chats and callsmenu to reduce data usage when making calls. As we noted with last month’s build, this feature didn’t affect call quality negatively, so feel free to give it a go.

WhatsApp [Android |iOS | Windows Phone | BlackBerry | Web via Android Police]

YouTube space Starts in India For Creators

YouTube space Starts in India For Creators

YouTube launched their  YouTube’s studios at many countries and many places for Creators. After Los Angeles, London, New York, Tokyo, Sao Paulo and Berlin, now its time for Mumbai, India. YouTube has announced that it will open its next studio and collaboration space in the Indian city soon.

The new Space will be set up at Film city, a major film and television production hub in Mumbai. YouTube is partnering with film school Whistling Woods International for this effort.

Over 11,000 videos have been created in YouTube Spaces since the first one was launched in 2012. Indian Creators are warm welcome the YouTube’s studio for their Country.

Its is One of the greatest chance to YouTube creators for free access a Whistling Woods’ studios and audio, visual and editing equipment, as well as training programs, workshops and community events.

There are lot of you tube videos uploaded and viewed by the indian peoples, So  It makes sense to open the next one in India, where Web video is steadily gaining momentum. Youtube says there is 1 million overall followers in the past two years in major local creators All India Bakchod and The Viral Fever

YouTube hasn’t officially announced the launching date, but as soon as possible they will launch their studious in India. But you may sign here for more updates

YouTube Space Mumbai – Coming soon! [Google India Blog]

Featured Image Credit [you tube and google search]

 

Google Officially Announced Version 6.0 Android M is Marshmallow

We all knew that the Android – 5.0 version named as “Lollipop” and after that google working with Android Version 6.0. Google also Give the Product for alpha testing to some countries with some of android phones. While we didn’t know what Android would be called at the time, now we do.
Google officially announced version 6.0 Android M is Marshmallow

Every one knew that google kept the Android name select from india candy name so the MARSHMALLOW is one of the Indian candy’s name.

Android M is Marshmallow
Marshmallow Candy

Along with the name, Google is releasing a final developer preview of Marshmallow, and SDKs for Android 6.0 — Marshmallow’s official build number. Developers can also start publishing apps to Google Play that have all the latest APIs (currently level 23).

Developers are encouraged to test the new permission model for app updates and installs, and official support for fingerprint sensors and a power saving mode are also available.

version 6.0 Android M is Marshmallow

The final APIs are incremental; there’s nothing significantly different from the last preview build, says Google. Developers can also take advantage of Google’s new beta testing program for Marshmallow-ready apps published to Google Play.

Develop a sweet spot for Marshmallow: Official Android 6.0 SDK & Final M Preview [Google]

Tool for Check all Browser Compatibility

Every Web developers spend a lot of time working with check browser Compatibility.  A handy Node package makes it easy,  Using this feature  you’re trying out is compatible with enough browsers to implement it.  Website that makes easy query for standard adopted across all browsers and various devices. You can use extension package as NPM package

Browser Compatibility

When you’re curious if you can use something like Web sockets, it’s as simple as typing ‘caniuse websockets’ at the terminal and you’ll get an instant answer about how well it’ll work across browsers.

It’s a nice little tool that’ll make your development workflow even better — no more jumping outside of your coding environment to the Web browser to check compatibility.

Microsoft is testing a news reading app NewsCast

Microsoft is testing a news reading app Newscast.   Newscast application which makes a playlist of news story summaries and reads them to people. The publication came across a page on the Microsoft Azure Web Sites domain that had the app for download. As described by the Microsoft Bing team programmer working and designing with this application.  The product was designed with more friendly by the users, they can listen to playlist even while driving. Unfortunately, the download’s no longer available, but Neowin managed to take some screenshots that you can see below the fold.

NewsCast reportedly uses Bing’s text-to-speech program to read out blurbs that last 30 seconds each, though the voice isn’t as organic as Cortana’s. It allows you to save summaries for later and also has a feedback button that launches a three-question survey for testers. Curiously, the app that was on Azure was available only for iOS devices, though it’s probably because a lot of Microsoft employees/testers use iPhones and iPads. As you can see, it’s not quite identical to the breaking news app Facebook’s reportedly developing, as well, but the two could very well be rivals in the future.

NewsCast Microsoft news reading app

[Image credit: JeepersMedia/Flickr, Neowin]

Featured image Credit : Flickr

Google gets new company name under “Alphabet – collection of companies”

Google founders Larry Page and Sergey Brin have started a new “collection of companies” called Alphabet — and it includes Google. That’s right, now there’s a company bigger than Google.

The new holding company will include all of Google’s current properties, with the largest of course being Google itself. Sundar Pichai will become CEO, getting a promotion from his previous role as Senior Vice President.

Page is now CEO of Alphabet, while Brin is President. Alphabet comprises Google and other companies that have been housed under its primary-colored umbrella, including the X lab (which is building delivery drones), investment arms Ventures and Capital, and health-focused efforts Calico and Life Sciences.

page says “This newer Google is a bit slimmed down, with the companies that are pretty far afield of our main internet products contained in Alphabet instead.”  The change should allow Alphabet to better manage and scale products in fields that aren’t directly related.

Alphabet is also replacing Google as a publicly traded entity. All Google shares will be automatically be converted into the same number of shares from Alphabet, with Google becoming a wholly-owned subsidiary of the new company. Both of its types of shares will continue to trade as GOOG and GOOGL on Nasdaq.

This new structure will allow us to keep tremendous focus on the extraordinary opportunities we have inside of Google. A key part of this is Sundar Pichai. Sundar has been saying the things I would have said (and sometimes better!) for quite some time now, and I’ve been tremendously enjoying our work together.

Page and Brin hope that each Alphabet company will be able to run independently and develop strong individual brand identity.

YouTube, for instance, could in theory begin to shed some of its heavy Google association – dropping Google+ is a start – and become more of its own entity. Future acquisitions – looking at you, Twitter – could also continue to run largely on their own.

As for why the need for the name change: Google is simply too heavily associated with search.

As for the name, Page adds that language is at the core of Google search. Plus, “it means alpha‑bet (Alpha is investment return above benchmark).” Besides, Alphabet can be a great workout:

G is for Google [Google Official Blog]