MySQL
How To Print MySQL Dates In mm/dd/yyyy And dd/mm/yyyy Formats
Submitted by Sudheer on Sun, 07/06/2008 - 14:10.When choosing the MySQL field type to store dates, date is the preferred type. MySQL stores dates in the format yyyy-mm-dd which is seldom used to print dates on web pages. As a PHP developer you will eventually come across a need to convert the MySQL date format into dd-mm-yyyy or mm-dd-yyyy or another format. This post tells you how you can do that in your PHP programs.
Let us create a hypothetical situation to demonstrate the program.
Create the MySQL table.
CREATE TABLE dates (
name varchar(30),
birthday date
) Insert sample data with dates.
Two Commands To Move Your MySQL Database To A Different Computer
Submitted by Sudheer on Wed, 01/23/2008 - 15:11.Many popular web applications are written in PHP and use MySQL database. In this post I will describe, how you can move your database to a different computer. Almost all web applications store database and files system information in configuration files. You can actually move your web application to a different server without much hassle by editing few lines in these configuration files. I will write more about the configuration files of web applications in a different post. In this post I will walk you through the steps to move your MySQL database to a different server. The commands will help you move both data and schema.
What do you need to know before moving a database? On both the computers you will require the
- MySQL database name
- MySQL username that has access to the database
- Password for the username that has access to database
You can take a backup of your database in the form of SQL dump and restore it on another server quickly from the Shell. Later in the post we will discuss how you can import and export MySQL databases using a graphical tool.
Launch the terminal. If the server is accessible remotely using SSH you can execute these commands on the secure shell.
Command 1 to generate the backup
mysqldump -u mydatabaseuser -p mydatabase > backup.sqlHow To Install LAMP
Submitted by Sudheer on Tue, 01/01/2008 - 10:43.
LAMP is an acronym which stands for Linux, Apache, MySQL and PHP. The letter P also stands for Perl and Python programming languages. LAMP is a free software stack which powers, primarily, web servers. Most GNU/Linux distributions bundle these packages in the install media and repositories. Let us take a look at how to install LAMP using Fedora. I will restrict the P in LAMP to PHP only for this article. Perl and Python fans, bear with me.
While installing Fedora you can choose to install "Web Sever" which contains these packages. You can install them later also. Let me walk you through the actual steps to get LAMP working on your computer. I assume you are running Fedora 8 on your computer.
1. Launch the terminal by clicking
Applications>System Tools>Terminal
Recent comments
2 days 1 hour ago
2 days 5 hours ago
2 days 23 hours ago
3 days 21 hours ago
3 days 21 hours ago
5 days 22 hours ago
1 week 6 days ago
1 week 6 days ago
3 weeks 1 hour ago
5 weeks 1 day ago