Archive for April, 2010

openSUSE 11.3 Milestone 6

Officially openSUSE team not yet announced the release of milestone 6 for openSUSE 11.3. But there are download mirrors available to download it.

gwdg again is the 1st to provide iso for openSUSE as always.

http://ftp5.gwdg.de/pub/opensuse/distribution/

Here is the download link from openSUSE site:

http://software.opensuse.org/developer/en

This post will be updated upon release announcement of openSUSE11.3 M6 from openSUSE team with details.

———————————————————————————————

Update (04-05-2010):

This link will guide you to have an eye on the updates and features for M6.

———————————————————————————————

Arif

Popularity: 7%

Write to excel sheet in PHP from MySQL tables

Hi folks,

Some time we need to have a CSV file and store our database data in it for reporting and other things. To create such file on the fly we will need PHP, Apache and MySQL installed which i am sure is installed. What this script will be capable of:

  • Get data from MySQL table
  • Export multiple rows from db
  • Save file with different file name with date & time

Here is the script. One would need to connect to database and the rest of explanation i write in the comments inside the script to explain the lines.

<?php
//db.php connection to your database

// Query to get results from mysql table
$query = “SELECT id,name,phone,address FROM user”;
$res = mysql_query($query);

// Functions for export to excel.
function xlsBOF() {
echo pack(“ssssss”, 0×809, 0×8, 0×0, 0×10, 0×0, 0×0);
return;
}
function xlsEOF() {
echo pack
(“ss”, 0x0A, 0×00);
return;
}
function xlsWriteNumber($Row, $Col, $Value) {
echo pack(“sssss”, 0×203, 14, $Row, $Col, 0×0);
echo pack(“d”, $Value);

return;
}
function xlsWriteLabel($Row, $Col, $Value ) {
$L = strlen($Value);
echo pack(“ssssss”, 0×204, 8 + $L, $Row, $Col, 0×0, $L);
echo $Value;

return;
}

// Unique file name with datetime
$file_name = “csv-”.date(‘dmy-His’);
header(“Pragma: public”);
header(“Expires: 0″);
header(“Cache-Control: must-revalidate, post-check=0, pre-check=0″);
header(“Content-Type: application/force-download”);
header(“Content-Type: application/octet-stream”);
header(“Content-Type: application/download”);;
header(“Content-Disposition: attachment;filename=$file_name.xls “);
header(“Content-Transfer-Encoding: binary “);

xlsBOF();

// Top of the excel sheet to write header
xlsWriteLabel(0,0,”User Data – CSV”);

// Make column labels. (at line 3)
xlsWriteLabel(2,0,”Id”);
xlsWriteLabel(2,1,”Name”);
xlsWriteLabel(2,2,”Phone”);
xlsWriteLabel(2,3,”Address”);

// To start writing from row three from top
$xlsRow = 3;

// Put data records from mysql by while loop.
while($row=mysql_fetch_array($res)){

xlsWriteNumber($xlsRow,0,$row['id']); // 0 indicates column number
xlsWriteLabel($xlsRow,1,$row['name']);
xlsWriteLabel($xlsRow,2,$row['phone']);
xlsWriteLabel($xlsRow,3,$row['address']);

$xlsRow++;
}
xlsEOF();
exit();
?>

This script is tested and working well. But if got any questions, use comment form for the feedback.

Arif

Popularity: 7%

openSUSE 11.3 Milestone 5 OUT NOW!

Milestone 5 of openSUSE 11.3 is available for download.

There is no official announcement yet from openSUSE team, as i get updates, will post here.

Download it from gwdg.

ftp://ftp5.gwdg.de/pub/opensuse/distribution/11.3-Milestone5/iso/

Update (15-04-2010):

Announcement from openSUSE.

Download from openSUSE developer zone.

Some new features:

  • Perl 5.12
  • PackageKit 0.6.2
  • RPM 4.8.0
  • Zypper 1.4.1
  • NetBeans 6.8
  • X11 7.5 and xorg-server to 1.8.0
  • gutenprint 5.2.4
  • Gnome 2.30
  • and many more…

Arif

Popularity: 5%

Upgrade to KDE4.4.2 in openSUSE 11.2

Hi folks,

Here i am with another tutorial of upgrading KDE in openSUSE11.2. KDE4.4.2 is released and available for installation in openSUSE Factory repo.

March 30th, 2010. Today, KDE has released a new version of the KDE Software Compilation (KDE SC). This month’s edition of KDE SC is a bugfix and translation update to KDE SC 4.4. KDE SC 4.4.2 is a recommended upgrade for everyone running KDE SC 4.4.1 or earlier versions. As the release only contains bugfixes and translation updates, it will be a safe and pleasant update for everyone. Users around the world will appreciate that KDE SC 4.4.2 multi-language support is more complete. KDE SC 4 is already translated into more than 50 languages, with more to come.

Official Release Announcement

Change log

So now lets start the upgrading process. There are two methods to upgrade, it’s upto you which one you choose and best fits your needs.

Method-1:

1- 1st of all we will have factory and community repos. Add repos from here (Just follow step-1 from there).

2- Now open software management in YaST and choose repositories tab, select the repo you just added with some name, and perform the action showed in the figure below, Click “Switch system packages”. And do the same with community repo too. And click Accept button.

click to enlarge

3- Wait for the downloading and installation to finish. Logout and Log back in OR Restart your PC.

Method-2:

1- Open Terminal and become root by su -, and type:

zypper dup

2- Type y upon asking for upgrading.

OR follow the same instruction from the image below:

click to enlarge

NOTE: Method-2 will update the system wide packages, so if you don’t want to upgrade some packages follow Method-1.

Good Luck with it. If have any questions, problems in upgrading use comment form to leave your feedback.

Arif

Popularity: 26%