Skip to main content

Posts

Compare two dates using php string comparison

Here is a small script in PHP to compare 2 dates This comparison will work if dates are in "YYYY-mm-dd" format Try this Your self $date1="2012-05-20"; $date2="2012-05-20"; if( $date1 > $date2 ) echo "$date1 greater than $date2"; elseif( $date1 == $date2 ) echo "$date1 equal to $date2"; else echo "$date1 lower than $date2"; Just changed this to a function function strDateCompare($date1,$date2){ if( $date1 > $date2 ) return "$date1 greater than $date2"; elseif( $date1 == $date2 ) return "$date1 equal to $date2"; else return "$d1 lower than $d2"; } call the function as given below: ------- ------- echo( strDateCompare("2012-05-20","2012-05-20") ); //this will return "2012-05-20 equal to 2012-05-20" ------ ------ echo( strDateCompare("2011-03-15","2012-05-20") ); //this will return "2011...

HOW TO DELETE DUPLICATE RECORDS FROM A MYSQL TABLE BY KEEPING ONLY ONE RECORD WITH HIGHEST OR LOWEST ID VALUE

HOW TO DELETE DUPLICATE RECORDS FROM A MYSQL TABLE BY KEEPING ONLY RECORD WITH HIGHEST OR LOWEST ID VALUE Deleting duplicate records from a mysql table by keeping only record with highest or lowest id value. Here I am explaining this with an example table. Let the table name be "tbl_films" . The table has fields "fId" and "fName" tbl_films fId | fName ------------ 1 | Film1 2 | Film2 3 | Film1 4 | Film1 5 | Film3

How can We do INSERT and UPDATE through a single MySQL Query? - "INSERT ..... ON DUPLICATE KEY UPDATE" Syntax

How can We do INSERT and UPDATE through a single MySQL Query? - "INSERT ..... ON DUPLICATE KEY UPDATE" Syntax INSERT and UPDATE Actions in one MySQL Statement Usually Update functions will check for a record with given key and if it exist then function will execute the UPDATE Query else perform an INSERT Query. So here happens a SELECT query on Table Followed by INSERTION / UPDATION of a Record. You can do this in single MySQL query. How?

Email Spam - New Email Spam in the name of Reserve Bank of India (RBI)

Spammers worldwide and researching on new topics for buiding genuine looking spam mails. Here is a new one. Last day I got an email that states it is send from RBI :). A well written email, I am adding the email here. Please never reply to these type os emails. //-------EMAIL STARTS-----------// Subject: (RBI)PAYMENT NOTIFICATION From: "RESERVE BANK OF INDIA" @lt;info@rbi.in> Date:Tue, April 30, 2013 7:53 am To:"Recipients" @lt;info@rbi.in>

How to check whether RSS Feed XML is valid or Error free - RSS XML Validator - Online RSS Feed Validators

RSS XML Validator - How to check whether RSS Feed XML is valid or Error free? RSS Feed is a powerful tool to publicize your web contents.It Allows webmasters and content providers an opportunity to provide concise summaries of their web contents to prospective readers. Thousands of commercial web sites and blogs publish content summaries in an RSS feed. RSS feed comes in a an XML Format and there are online reader which can recogonize these type of files and fetch the content summaries delivered through the RSS XML. The RSS feed is updated whene ever a new post is published on the source site. Ususally there will be server side script which runs to fetch the summary of the post and add that to the rss file of the website.

How to add style sheet to an HTML page - Adding CSS to a web page - Cascading Style Sheets - External CSS - Inline Style Sheets - Internal Style Sheet - Jquery CSS

How to add style sheet to an HTML page - Adding CSS to a web page First of all What is CSS or Cascading Style Sheet? In Simple, we can describe it as a set of Style that is used to format a web page. Applying Style will give site a better user friendly look. Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in HTML and XHTML. There are basically 5 ways to add CSS to an HTML page External CSS File Include First Method is to add an externl CSS file to your web page. A simple css file may look like ----- ----- .txt{ color:#ffffff; font-size:14px } .txt2{ color:#000000; font-size:12px } ----- ----- the above style statments is saved in a file called mystyle.css How to include the external CSS file? In Your HTML file inside the HEAD tag place the following tag: <link rel="stylesheet" type="text/css" href="mystyle.css" /> H...


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog