Archive for the 'Programming' Category

PHP Questions

Over the Internet many people are searching for the interview question to get prepare for any PHP interview. He i am going to compile a series of such question collected from various source & my experiences. This Series will have both Q & A which will help others to achieve their tasks.

1.How can I maintain the count of how many persons have hit my site?
2. What is difference between mysql_fetch_array(), mysql_fetch_row() and mysql_fetch_object()?
3. How I can make a chat page in php in simple
4. What is the difference between echo and print statement?
5. What is differenc between mysql_connect and mysql_pconnect?
6. How I can get IP address of the usr?
7. How I will check that user is logged in or not?
8. I want to make it a function and I want to use it in each page and after login I want to go in current page?
9. How do we know browser properties?
10. If you have to work with dates in the following format: ?Tuesday, February 14, 2006 @ 10:39 am?, how can you convert them to another format, that is easier to use?
11. What is difference between require_once(), require(), include()?

Share This Post

MySQL Backup Script

This evening while traveling back from office, one of my friends called me seeking for a help. He was asking me a method or script to backup MySQL database periodically. His initial choice was a simple PHP script to do it. But he gave another option saying that it’s OK to have it in any script, provided it should run under UNIX environment. I asked him some time so that I will reach my home, create the script and pass it to him.

As soon as I reached home, I started trying something with PHP initially in which I was not satisfied. So I decided to do it with PERL / Shell Scripting. This time I finalized to go with shell scripting since it had been a long time that I have done something with this Bash Shelling Scripting. So, here we go… I go this script in less than 10 minutes

#!/bin/sh

mysqldump -hostname -u username -p password dbname > dbbackup_%m_%d_%Y.sql

exit 0

I Guess this is my simplest script till date. Setting this script in cron once in a day will create new backup every day. If you want to have periodic backup differentiate by hours then, add the hour & minute information to the filename in the script

Share This Post

Wordpress 2.3 beta-1

Today i just happen to see that there is a wordpress beta release, i.e., wordpress 2.3 beta-1. As this beta its strictly for Professionals, who are familiar with php. As stated by the community. I am a php professional and i have never tried any of the wordpress beta release, so today i thought that let me do it.

Around 9.30 PM IST, i have updated all my file and upgraded my database as well. Upgrading database ?? ya of course as this version of wordpress have some new features there are some new tables which needs to be created. The two main new feature which i was pretty impressed with are inbuilt TAGS & plugin and core update notification. What is it all about.

Continue reading ‘Wordpress 2.3 beta-1′

Share This Post