WampServer 2.1a Problem with phpMyAdmin

This is the latest release of Wampserver. Once you install it, it was pretty fine as if you have experience with it before. However this time, you have to change the “root” password to log in.

- PhpMyadmin 3.2.0.1

user : root

Password :root

- SQLBuddy 1.3.2

user : root

Password :root

 

Since mySQL server confiq file still use the old configuration code of ” root” with NO password, we need to go to edit it.

GO to

C:\wamp\apps\phpmyadminVersion\confiq.inc.php

and replace this

$cfg['Servers'][$i]['password'] = '';
with

$cfg['Servers'][$i]['password'] = 'root';

 

Then restart the wampserver, everything will be normal. have fun

 

 

 

By Oudom Posted in PHP

To allow your new custom Post Page UI can be work with All In one SEO pack, just go to edit your plugin, go to all-in-one-seo-pack/all_in_one_seo_pack.php then find the following code, and add name
of your new Post type names:
if($mrt_aioseop_pt == 'post' || $mrt_aioseop_pt == 'page' ||$mrt_aioseop_pt == 'angkor' || $mrt_aioseop_pt == 'cambodia' || $mrt_aioseop_pt == 'phnompenh' || $aioseop_mrt_cpt)
.............
and
 add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','angkor');
 add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','cambodia');
 add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','phnompenh');

The code will become like this. 

function aioseop_meta_box_add() {
	if ( function_exists('add_meta_box') ) {
		if( function_exists('get_post_types')){
			$mrt_aioseop_pts=get_post_types('','names');
			$aioseop_options = get_option('aioseop_options');
			$aioseop_mrt_cpt = $aioseop_options['aiosp_enablecpost'];
			foreach ($mrt_aioseop_pts as $mrt_aioseop_pt) {
				if($mrt_aioseop_pt == 'post' || $mrt_aioseop_pt == 'page' ||$mrt_aioseop_pt == 'angkor' || $mrt_aioseop_pt == 'cambodia' || $mrt_aioseop_pt == 'phnompenh' || $aioseop_mrt_cpt){
					add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta',$mrt_aioseop_pt);
				}
			}
		}else{
			add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','post');
			add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','page');
                        add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','angkor');
			add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','cambodia');
			add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta','phnompenh');
		}

	} else {
		add_action('dbx_post_advanced', array($aiosp, 'add_meta_tags_textinput'));
		add_action('dbx_page_advanced', array($aiosp, 'add_meta_tags_textinput'));
	}

Random Index in PHP without repeating index

HI, this is the algorithm I create it, hope it will be of good use.

$totalData =count($allData);
	     $randIndex = array();
               for($i=0;$i<$totalData;$i++)
               {
                $randIndex[$i]= rand(0,$totalData-1)  ;
                 do{
				  $hasIt = false;
                  for($j=0;$j<$i;$j++)
                   {
                    if($randIndex[$j]==$randIndex[$i])
		    {
		 $randIndex[$i]=rand(0,$totalData-1)  ;
		 $hasIt = true;
		   }

                   }
                   }while($hasIt);
                }
SO, for your output result:
for($i=0;$i<$totalData;$i++)
{
echo $randIndex[$i];
}
By Oudom Posted in PHP

Update Category name from the name in HQ , with Script

SELECT A.[ID]
      ,A.[Name]
      ,A.[Code],
      'Update Category Set Name = ' + B.Name +'  WHERE Code = ' + A.Code +'' As script

  FROM [AS].[dbo].[Category] AS A, [HQSTOCK].[dbo].[Category] AS B WHERE A.[Code] = B.[Code]
  AND A.Name != B.Name
GO

87	Ready Framed Batik (M Hussin)	01005028	Update Category Set Name = Ready Framed Batik (Alim)  WHERE Code = 01005028
88	Ready Framed Batik (Zabid)	01005029	Update Category Set Name = Ready Framed Batik (Chin)  WHERE Code = 01005029
93	01001029	01001029	Update Category Set Name = Batik Paintings (Topo)  WHERE Code = 01001029
94	01001030	01001030	Update Category Set Name = Batik Paintings (Al-Kusuma)  WHERE Code = 01001030
95	01001031	01001031	Update Category Set Name = Batik Paintings (Haryati)  WHERE Code = 01001031
96	01001032	01001032	Update Category Set Name = Batik Paintings (Andre)  WHERE Code = 01001032
97	01005030	01005030	Update Category Set Name = Ready Framed Batik (Acholik)  WHERE Code = 01005030
98	01001033	01001033	Update Category Set Name = Batik Paintings (Chin)  WHERE Code = 01001033
SELECT C.[ID]
      ,C.[Name]
      ,C.[Code],
      'Update Category Set Name = ''' + C.Name +'''  WHERE Code = ' + C.Code +'' As script

  FROM [HQSTOCK].[dbo].[Category] AS C

Power Pivot Function

We can write functions in Pivot table to put condition on the data taken from DB.

Types of DAX Functions

DAX provides functions that have the same functionality and names as the Excel functions that you might already be familiar with. However, the functions have been modified to use DAX data types and to work with tables and columns. In addition, DAX provides many specialized functions for specific purposes, such as lookups based on relationships, the ability to iterate over a table to perform recursive calculations, and calculations utilizing time intelligence.

Read more about the following types of DAX functions:

LinkedIn IPO now

 

What is LikedIn, I see them long ago but never really find why is it there.  From wiki,

LinkedIn (pronounced /ˌlɪŋkt.ˈɪn/) is a business-oriented social networking site. Founded in December 2002 and launched in May 2003, it is mainly used for professional networking. As of 22 March 2011, LinkedIn reports more than 100 million registered users, spanning more than 200 countries and territories worldwide.The site is available in English, French, German, Italian, Portuguese and Spanish. Quantcast reports Linkedin has 21.4 million monthly unique U.S. visitors and 47.6 million globally.

That might makes sense why is available in the internet world. There is something so surprise happen yesterday ( 19 May 2011). It first initial public offering (IPO) was a huge success.  For just one day, the IPO has nominated millionaires and one billionaire to the family of oh-so-fast-getting-rich gang.

courtesy of Yahoo finace

Buyers crowded the floor of the New York Stock Exchange, and financial news networks flashed LinkedIn’s stock price urgently all day. By the closing bell, the company had a market value of $9 billion, the highest for any Internet company since Google had its initial public offering seven years ago. Millionaires and even one billionaire were made, at least on paper.

The stock, issued at $45, went as high as $122.70 just before noon and closed at $94.25 on a trading volume of 30 million shares. All this for a company that skeptics say amounts to an online Rolodex, a place on the Internet for professionals to post resumes and connect with one another and potential employers.

It was enough to remind some people on Wall Street of the heady late 1990s and the debuts of companies like Netscape Communications — and, more infamously, long-forgotten names like Pets.com and Webvan. Investors wondered whether LinkedIn will be a precursor to another financial frenzy in Silicon Valley.

Concatinate String in SQL 2008

SELECT [BarcodeNumber] + ';' AS BarcodeNumber

        ,([Description]+ ';') AS Description
        ,CAST(c.[Code] AS nvarchar) + ';' As CategoryID
        ,CAST(d.code AS nvarchar)  As DepartmentID

  FROM [HQSTOCK].[dbo].[Item] AS i, [HQSTOCK].[dbo].[Category] AS c , [HQSTOCK].[dbo].[Department] AS d
  WHERE i.CategoryID = c.ID And i.DepartmentID = d.ID
GO

update description with substring.

UPDATE [ECOWARNA].[dbo].[Item]
 --  SET [Description] = [Description]+ ' '+ CONVERT(VARCHAR(4),[BarcodeNumber], 120)
   --SET [Description] = 'Tongkat Ali Kuning Root'
    SET [Description] = [Description]+ ' '+SUBSTRING([BarcodeNumber],10,4)

 WHERE [Description] like '%Tongkat Ali Kuning Root%'
GO

Auto Back up and Auto Restore in Remote server

In Sql server in my case 2008, these are the steps you need to do:

        1. Creat the auto back up schedule:

                 In MS SQL server studio,  go to maintenence – > SQL server Maintenance Plan wizard, and fill in the form of the place where you store your back up file.

         2. Write the stored procedure to send those file to any FTP host server.

        3. Exe the stored procedure

        4. Retrive the