Top "Mysql" questions

MySQL is a free, open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL).

MySQL foreign key constraints, cascade delete

I want to use foreign keys to keep the integrity and avoid orphans (I already use innoDB). How do I …

mysql foreign-keys innodb
Select records from NOW() -1 Day

Is there a way in a MySQL statement to order records (through a date stamp) by >= NOW() -1 so …

mysql select where datestamp
Simple way to calculate median with MySQL

What's the simplest (and hopefully not too slow) way to calculate the median with MySQL? I've used AVG(x) for …

sql mysql statistics median
Select last N rows from MySQL

I want to select last 50 rows from MySQL database within column named id which is primary key. Goal is that …

mysql database
PHP 7 RC3: How to install missing MySQL PDO

I am trying to setup webserver with PHP 7 RC3 + Nginx on Ubuntu 14.04 (for test purposes). I installed Ubuntu in Vagrant …

php mysql ubuntu pdo php-7
UPDATE multiple tables in MySQL using LEFT JOIN

I have two tables, and want to update fields in T1 for all rows in a LEFT JOIN. For an …

mysql sql-update
SQL injection that gets around mysql_real_escape_string()

Is there an SQL injection possibility even when using mysql_real_escape_string() function? Consider this sample situation. SQL is …

php mysql sql security sql-injection
How to use MySQL DECIMAL?

I can't quite get a grasp of MySQL's DECIMAL. I need the row to be able to contain a number …

mysql
How to test if a string is JSON or not?

I have a simple AJAX call, and the server will return either a JSON string with useful data or an …

javascript mysql json
How to do this in Laravel, subquery where in

How can I make this query in Laravel: SELECT `p`.`id`, `p`.`name`, `p`.`img`, `p`.`safe_name`, `p`.`sku`, `…

php mysql laravel eloquent subquery