Delete all duplicate rows except for one in MySql having no primary key. Someone asked me to delete all rows from a table except one entry with a single query. This is not so easy for me :), Anyway after work and research I have found the solution, I am sharing with you How you can…
Use non-standard font in web pages Normally your website visitors can only see the fonts that are already installed on their system. So if you use a font(non-standard) that is not installed on site visitor’s computer then his browser will show some other font that is on their computer. That’s why when you are…
PHP: Access control modifiers One of the fundamental principles in OOP(Object Oriented Programming) is ‘encapsulation‘. The idea is that you create cleaner and better code, if you restrict access to the data structures (properties) and methods in your objects. The access modifier is the most important feature of the OOP language and it…
What is the difference between htmlspecialchars and htmlentities PHP functions? htmlentities: This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities. htmlspecialchars: Some characters have special significance in HTML, and should be represented by HTML entities if they…
What is the difference between cookies and session? HTTP is a stateless protocol. That mean, that treats each request as an independent transaction that is unrelated to any previous request. So, how about the request we want to make frequently, like username or id? As you know, we could store our data in COOKIE.…
Complete guide of cookies and session in php SESSION Many New PHP developers are often confused whether to use sessions or cookies for their websites. Both cookies and sessions have their advantages and drawbacks. PHP developer should first understand the differences between each so that he can choose better option according to need.…