Ask the community if you have any question about PHP,
MySQL, Apache and Linux for quick answers!!!

MySQL 5.0.77 in RHEL 5/CentOS 5

Red Hat Enterprise Linux 5 and CentOS 5 are now shipping MySQL 5.0.77 instead of MySQL 5.0.45 on security grounds.

This is moderate security release according to RHEL and CentOS.

Comments

MySQL for online applications – Webinar Series

MySQL.com is conducting webinars on its usage in online applications. It is a series of 5 webinars i.e.

Part 1: Introduction to MySQL Scale Out and Replication Services
In the first installment we look at the basics for deploying MySQL for a scalable online application such as:

  • Choosing the right architecture
  • Scale Out - What, Why and How?
  • Using MySQL Replication Services
  • MySQL Solutions to help manage your high-growth business

North America -- Tuesday, August 18, 2009: 10:00 Pacific time / 1:00 Eastern time

EMEA -- Wednesday, August 26, 2009: 10:00 am European Central Time

Comments

PHP sessions across subdomains

If you are facing problems sharing sessions across subdomains, use the following code before session_start().

ini_set ( 'session.cookie_domain', '.mysite.com' );

Replace mysite.com with your domain name.

Comments

PHP 4 is dead, last release of PHP 4!!!

The last release of PHP 4 is now available for download on 7th of August 2008. PHP 4 has been serving the web sites since 2000.

Comments

Count number of words in a MySQL column

It is a common requirement to count number of words in a column of a MySQL database table. But MySQL does not have any built in function to count number of words as it usually has for number of purposes.

But you don't need to worry about it. It can be achieved with a simple trick e.g. you have a column name and want to count number of words in it. This query will return number of words separated with space in a column

SELECT SUM( LENGTH(name) - LENGTH(REPLACE(name, ' ', ''))+1)
FROM table

If you want to count number of words separated by some other string for example comma (,) or semicolon (;), simply replace space with your required character.

Comments (14)

MySQL GUI Tools

I am creating a list of MySQL GUI (front end) tools. I hope you will contribute this list.

A wide variety of MySQL GUI tools are available in the market. Most of them are free but some are paid as well. We can divide GUIs in 2 categories i.e. desktop and web based applications. Here is the list of popular MySQL GUI tools I have heard of

  1. Desktop Application
  2. Web Based Application

If you know any good GUI Tool, please let me know.

Comments (3)

Should we use template engines in PHP?

I came across this discussion today on pros and cons of using template engines in PHP.

Comments

child pid 2299 exit signal File size limit exceeded (25)

Today I found that Apache on my server was very slow and a lot of child pid xxxx exit signal File size limit exceeded (25) errors in error_log.

I simply searched for large (2gb) log files and deleted them. Everything became normal.

Comments

Increasing file upload limit in PHP

There are different options to increase file upload limit in PHP. First is changing PHP configuration file (php.ini) and restarting webserver or overwriting the php.ini value in .htacces (this option is available if you are running Apache).

There are 2 directives which affect upload limit i.e. upload_max_filesize and post_max_size.

Now we look at the first method. First you have to find out where the php.ini is. To find out the location, make a .php file containing only this code and place it in your webroot and point your browser to this file.

< ?php phpinfo(); ?>

In the page output you can find Configuration File Path. Open this file and change the values for upload_max_filesize and post_max_size according to your requirement e.g. to set 10MB upload limit, the values will be
upload_max_filesize = 10M
post_max_size = 10M

Read the rest of this entry »

Comments

Saving images in MySQL with PHP

People have different opinions on saving images in database. Some says, "Why bother database if we can handle this by saving images to disk". I am agree with this;).

Most of the requirements can be fulfilled by saving the images to disk. This reduces the unnecessary load on MySQL.

Here is the small code to save the image in MySQL with the help of PHP.
Read the rest of this entry »

Comments (38)

Download data as csv using PHP

This is a very simple example to download data in csv format using PHP and MySQL. I have used a table with two columns i.e. id and name.

The main point to download file is a proper use of header(). It has said many times in many places but I repeat here, "Make sure there must not be any sort of output (including whitespaces) before header()". We can also set a default file name for the file.

Here is the PHP code
Read the rest of this entry »

Comments (12)

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »