Recently I did security and pen-testing assessment of a web application written entirely in PHP, and some of the biggest issues I’ve come along were in-code vulnerabilities to 💉 SQL injections. To fix this, I recommended using prepared...
Recently we had a case where we needed to limit the PostgreSQL user activities to only a single connection per user, and in this article I’m going to share the experience with you. The connection limit is applied during the session connection...
pg_activity is a great command-line tool for PostgreSQL server activity monitoring., and we are gonna show you how to install it and use it on a Linux machine. But what happens when someone that doesn’t have access to that Linux machine, wants...
Simple Answer: You will never use a index this way. Lets look at the following examples: EXPLAIN SELECT * FROM `wp_posts`; +—-+————-+———...
ORM Package for Node.js. Works with MySQL, PostgreSQL and SQLite. var orm = require('orm'); orm.connect("mysql://username:password@host/database", function (err, db) { if (err) throw err; var Person = db.define('person', { name : String, surname :...
The SELECT statement is used to select or fetch data from a your MySQL Database. It’s the most common type of query issued to a database. There are many ways to query a database, but were going to focus on the SELECT statement...
If you have deleted a large part of your table or updated many variable length rows, you should consider running the optimize command. If you want to quickly generate the optimize commands for every table in you database, executing the...
This list is the PHP version »SQL to Mongo correspondence table (there is a more general version in the official MongoDB manual). SQL queryMongo query statementCREATE TABLE USERS (a Number, b Number)Implicit creation...
Put it in a daily cronjob if you like, or extend it to copy the backup to another machine:
I heard this one again last week, and I’m not sure why it’s still going around. Microsoft changed the behavior of Truncate Table to be able to be rolled back, but this myth had been taught to DBAs for so many years, that I think some...