Object Handling in PHP4, PHP5

In PHP4, objects are passed by value and in PHP5 objects are passed by reference.

A sample program is shown below to get a better idea on this topic. Continue Reading…

MySql Tip for Beginners – Import records from .csv from Command line

Importing a .CSV file in MySQL from command line.

When you want to import records from a .csv file into a table, follow the steps given below:

[root@localhost]$ mysql -u [username] -p [password] [root@localhost]$ use [my_database] [root@localhost]$ LOAD DATA LOCAL INFILE ‘userinfo.csv’ INTO TABLE [table name] FIELDS TERMINATED BY ‘,’ LINES TERMINATED BY ‘\n’;

This should be the same command that get executed on windows command prompt as well.

MySql Tip for Beginners – Export records to .csv from Command line

Exporting a .CSV file based on user requirement is very easy in MySQL.

A simple query could generate your desired output as .CSV file. Let’s see what that command is

[root@localhost]$ mysql -u [username] -p [password] [root@localhost]$ use [my_database] [root@localhost]$ SELECT * INTO OUTFILE ‘/userinfo.csv’ FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”” ESCAPED BY ‘\\’ LINES TERMINATED BY ‘\n’ FROM Table_Users;

Voila! You have your desired results in as a .csv file.

In the next article, we will discuss on how we can import data from .csv file back into database.

How to shutdown Mysql from command prompt?

To shutdown mysql from command prompt, issue the following command in Linux box

[root@computer /]# mysqladmin -u root -p shutdown

In windows,

C:\mysql\bin> mysqladmin -u root -p shutdown _

User interface: Browser modes

Different browser modes

To ensure backward compatibility with older browsers, browser creators had different modes for sites that work for different browser specifications

* Standard mode in Browser:
Browser renders a page according to the specifications set

* Quirks mode in Browser:
Browser loosely renders the page and manipulates the box model differently which happens to be in sites built for IE 5.5 (and lesser versions) or Opera 7 browsers

* Almost standard mode in Browser:This is a mode in Firefox/Safari browsers where they handle the tables quite differently from standard mode Continue Reading…

Mplayer: Codec for audio format 0x162

What is CODEC and how does it work?

CoDec stands for Compressor/Decompressor which is related to media files and which enables them play videos & audios.

Size of the video or audio content would be very large without these codecs and it is for this very reason we use codecs to compress these media files to help enable transmission. When these files are played, they are then decompressed by these codec programs. Continue Reading…

What is 310 redirect and 302 redirect?

301 redirect happens when a page has been moved/removed and is no longer available. When this happens, you can direct the user to the new page location and explicitly state for the crawlers that the page has been permanently moved to the new location Continue Reading…

MySQL – Steps for Better SQL Performance

Steps to make MySQL produce optimized results

» Identify the queries that execute slowly
» Watch for Opened Sql connections
» Carry benchmark test on Queries
» Execute queries with Explain statement to the performance of each queries
Continue Reading…

Linux: How to play .avi files on CentOS?

Easy steps to play.avi file in a Linux box

Searching on google I came across this link initially but didn’t understand what it really did and so skipped the link. It was after searching for various other .avi files I came across this link again which made the mplayer installation an easier task. Continue Reading…

Kurinchi Calendar
October 2018
M T W T F S S
« Oct    
1234567
891011121314
15161718192021
22232425262728
293031