Posts Tagged with "mysql"

SQL injections. Preventive security.

Posted by Stanislav Furman on June 19, 2019

With this article I want to start a series of articles about web applications security. This topic is truly interesting, sometimes challenging and, of course, very important for any web developer. Even if you think that your website is small and is not attractive to hackers, keep in mind that your website, if it is vulnerable, can be used to trick random users or even attack an external system. For example, using a security hole in your system an attacker can spread an exploit.

In this article I will talk about preventive measures against SQL Injections (aka SQLi). Those are preventive measures that may help in case you have legacy code, or someone in your team accidentally (or blindly) writes code vulnerable to SQLi.

Continue reading

How to update fields from another table in MySQL

Posted by Stanislav Furman on May 28, 2014

This article is to continue the series of short handy MySQL tips that I started a while ago. 

If you need to update a number of column fields in a MySQL table with data from another table, there is a simple way to do it. Lets say you need to update user phone numbers in table1 with the corresponding phone numbers from table2. Then you could run the following query.

Continue reading

Meet AMPPS - a good alternative for XAMPP and WAMP

Posted by Stanislav Furman on October 7, 2013
Meet AMPPS - a good free alternative for XAMPP and WAMP

Concatenating NULL and blank fields in MySQL

Posted by Stanislav Furman on May 17, 2013
How to concatenate empty and null fields in MySQL database

MySQL. How to insert a row or update if exists in MySQL.

Posted by Stanislav Furman on February 25, 2013

Being a web developer, I personally like short solutions, and when I code, I try to write as less code as possible. At the same time the code has to be readable for other developers without using comments.

If you want to combine create/update function into one, MySQL offers you a very useful statement : INSERT ... ON DUPLICATE KEY UPDATE.

Continue reading