Pages

Monday, October 31, 2011

Today I was working in project and I was confronted by one problem. As I live in Europe, the date's format are not the same in United States even MySQL. US use mm/dd/yyyy format, Europe use dd/mm/yyyy and MySQL use yyyy-mm-dd.

After I researched on PHP and MySQL official sites, I wrote algorithms that allowed me insert correctly data in SQL.

Saturday, October 22, 2011

osCommerce (open source Commerce) is an e-commerce and can be used on web server that has PHP and MySQL installed. You can simply download on this site. After you download, you have to unzip and copy to a folder on web server.

The goal of this post is show you how to install osCommerce. I am installing on a virtual machine that works like a web server (LAMP) to simulate real scenario of installation osCommerce.

If you don't know install or configure a web server on Ubuntu, please read this post or see this video.

If you already installed LAMP, please following the next steps to install:

After modifying the permissions, will show up the next screen. Press the button "Continue";

Step #6

It will show up a form where you have fill with right values. But I didn't create a database yet. For that, I went to terminal and typed "mysql -h localhost -u root -p" to login MySQL Server. And then, I created database called "oscommerce" with next command: "create schema oscommerce". Finish! Now you can fill form like you can see in third image.

Note: I made a mistake to input "192.168.1.199" instead a right IP address which is localhost or 127.0.0.1.

Step #7

Step #7

Step #7

I agreed with those values by default. If you want to change, you are comfortable to change.

Step #8

The next form is about your online store. You have to give information like your online store name, owner name, owner email address, administrator username and administrator password.

Step #9

Please read the post-installation notes. It is very important follow the steps to finish the installation.

Step #10

The next image will demonstrate you how to set permissions on step #3 and #4 according the previous image.

Step #11

Then, type in your browser: http://localhost/oscommerce/catalog/admin. This address will drive at administrator page where you have insert administrator username and password.

Step #12

Follow the path Administration Tool -> Tools -> Security Directory Permissions. This page will list permissions that you have change to with command "chmod 777 ..." like you can see in first image. After you changed permissions, press F5 to reload page to see values changed. Finish! You already finished the part of administration. Now let see the online store.

Friday, October 14, 2011

Today I found out a great, great application to modeling data. I am working to create information system to company where I work. And I need a software where I am able to drawing data model. I went to Google and tried Gliffy. Gliffy is absolutely amazing. Much better than Microsoft Visio, no offense Microsoft.

For who work with Microsoft Visio, always can drawing and exporting diagram in SVG.

Saturday, October 8, 2011

I am so regretted to install OpenSUSE in my 9 years old PC. I wanted to install Compiz but I could not install because there are problems between KDE and Compiz. I wanted install Google Chrome instead update Mozilla Firefox, and also I could not install Google Chrome because of Zypper. What the hell is Zypper? Why can not I simply type 'apt-get install google-chrome'?

I already made a decision. I will install other Linux Distro with GNOME. I just wanted install Compiz, Google Chrome...

I am disappointed with OpenSUSE. I thought was fantastic but is not! However, I will show a picture with system information with OpenSUSE.

Friday, October 7, 2011

The TRY...CATCH construnct was introduced with SQL Server 2005 for error handling using T-SQL. Statements to be tested for an error are enclosed in a BEGIN TRY ... END TRY block.
A CATCH block immediately follows the TRY block, and error-handling logic is stored here. The following examples shows the basic syntax:

SQL Server evaluates each statement in TRY block sequentially. If a runtime error is encountered, control immediately jumps to the CATCH block, and error information can be retrieved, logged, and displayed to the user.

Tuesday, October 4, 2011

In past few weeks, I upgraded my 9 years old PC. I bought a Ethernet card, 1GB memory RAM and 160GB Hard Drive IDE/ATA to upgrade my old PC.

My question was what operating system I will install to my 9 years old PC. I was undecided between Ubuntu and OpenSUSE. So I researched more deep, and I found out a site who helped me a lot.

I had two choices: OpenSUSE or Fedora. To my surprise, Ubuntu had 90% of recommendation. So I ignored Ubuntu and I tried OpenSUSE and Fedora with LiveCD. After I experimented both, I decided to install OpenSUSE.

A variable is a container for a single data value of a particular type. In Transact-SQL (T-SQL), all variables are preceded by an @ symbol.

Local variables are used in T-SQL scripts for a variety of purposes including:

Storing values to be tested by control-of-flow statement

Acting as counter in a loop

Storing the results of an expression

Retrieving field values for a single record using a SELECT statement

Variable are also used to pass values into parameters for stored procedures and user-defined functions. When declaring a variable, you must specify its name, datatype and sometimes the length and precision of datatype. The DECLARE statement can be used to declare multiple variables by separating them with commas.

Example

DECLARE @var1 int, @var2 varchar(255);

The preferred way to set the contents of a variable is use the SET statement. It is also possible to use the SELECT statement to set the value of one or more variables.