Is there a SQL query that will always return zero results?

MySQL
If there is a MySQL/PostgreSQL/Oracle-specific solution, I'm curious about them all.
2 years ago

Is there a way to GRANT ALL PRIVILEGES to the same user from multiple LAN addresses in a single command?

MySQL
I'm using the following command GRANT ALL PRIVILEGES ON *.* TO 'user'@'ip' IDENTIFIED BY 'password' WITH GRANT OPTION; To grant all privileges to...
2 years ago

Convert default column value from datetime to varchar

MySQL
I have to add a varchar column to a table which defaults to the current timestamp. To do this I somehow need to convert the value from datetime to var...
2 years ago

PHP query to DB

MySQL
I have a table where I store information about every single time a page has been loaded. So I have these rows: id, ip, date. Now I want to SELECT the ...
2 years ago

Laravel 4 - Select rows where count of rows in joined table greater than 0

MySQL
I need to grab rows of users where rows of items exist. Here is my code so far: $users = DB::table('users') ->join('orders', 'orders.user_id',...
2 years ago

Form entry inserts a blank into database

MySQL
I created an attendance form and when I submit the form it redirects me to submit.php. However, when I check in phpmyadmin I get a blank row except fo...
2 years ago

Insert Blobs in MySql databases with php

MySQL
I am trying to store an image in the DataBase, for some reason it doesn't seem to work. Here's the structure of my table. mysql> describe ImageSto...
2 years ago

MySQL/MariaDB - LIMIT joined query result while not losing any primary ID

MySQL
I know how to limit a query results with LIMIT a,b but what if I want to LIMIT query that was created with JOINs which has multiple rows of one prima...
2 years ago

mysql select data from 2 tables, but 2nd table has dynamic cell names

MySQL
I have a table that holds product names, description, prices, etc and another tables were the admin can add custom columns to expand the first table. ...
2 years ago

INSERT no Result Value

MySQL
I'm trying to insert some value into my database, but I got no result, but the code got no error, and the result label said it is succeed. My database...
2 years ago

Display data through foreign key in cakephp

MySQL
in Index.php from my View of Turno I have this: <?php foreach ($turnos as $turno): ?> <tr> <td><?= $turno->has('c...
2 years ago

Regex - How two characters matching (MySql)

MySQL
Please find my query below. SELECT * FROM demoTable WHERE C_APPLICATION_REF_NO REGEXP '[A-Z]{1}[0-9]{0,14}'; why i am getting result which having t...
2 years ago

MySQL: Boolean query returning true if user has not set dnd or if user has set dnd given ID must be a friend

MySQL
I've these simple tables: 1. USER_DND ╔════════╦══════╗ ║ UserID ║ DnD ║ ╠════════╬══════╣ ╚════════╩══════╝ 2. USER_FRIEND ╔════════╦══════════╗ ║...
2 years ago

MySQL create stored procedure syntax with delimiter

MySQL
I am trying to create a stored procedure in MySQL using a delimiter like this: use am; DELIMITER $$ CREATE PROCEDURE addfields() BEGIN DECLARE do...
2 years ago

How can you determine how much disk space a particular MySQL table is taking up?

MySQL
Is there a quick way to determine how much disk space a particular MySQL table is taking up? The table may be MyISAM or Innodb.
2 years ago

How to use ALTER TABLE in MySQL on a column named partition

MySQL
I have a MySQL table with a column named partition. As it's a reserved keyword, I should be able to use backticks to use it in queries. It works with ...
2 years ago

PHP session variable only increments once

MySQL
I've been fiddling with PHP recently along with databases and I've come across a problem where I when I want to increment a session variable, question...
2 years ago

Delete Button SQL Database Windows Form Application

MySQL
How can I modify my delete button code to delete a selected row from my SQL database? Currently when I select one row and click the delete button all ...
2 years ago

Saving model with not nullable relationship

MySQL
Consider the following two relations: User: CREATE TABLE user ( id INT NOT NULL, social_provider_id INT NOT NULL, CONSTRAINT `user_social_provider_i...
2 years ago

SQL: count rows from 3rd table

MySQL
I have 3 tables, the first table is the account_has_account1 where i store the relation between accounts and it's columns are account_id, account_id1,...
2 years ago