Category "mysql"

Adonisjs How to cast boolean to false and true in a model instead of 0 or 1?

This is my table field (open) but in response, it returns 0 1 but I want true false instead of 0 1 I am using adonis MySQL table.boolean('open').notNullable().

Lost connection to MySQL server during query In codeigniter query ,Live site

I'm getting the following error on my live site. "Error Number: 2013 Lost connection to MySQL server during query" It was working fine before a day but now the

Select Names of city starting and ending with vowels from STATION table

Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplic

MySQL transaction FOR COMMITING ON TRUE IF

i need to make an sql transaction, that only commits the insert if the one date is greater than the other, and rolls back if else.. this is what i have: START

Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] for XAMPP and Eclipse IDE

I am using XAMPP server and Eclipse IDE for running a hibernate program. But I am getting the following error: **Apr 21, 2017 12:46:38 PM org.hibernate.Vers

How to escape a whole sql string instead of escaping each argument?

I use https://github.com/mysqljs/mysql.git library. I have a mysql db query architecture in which I can not modify the SQL query file one by one to escape each

MYSQL: Create Unique ID based on Another Column

If I have the following column in database: Email [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] I would like to ALTER

Correct way to use LIKE '%{$var}%' with prepared statements?

This does not work $sql = 'SELECT * FROM `users` WHERE username LIKE \'%{?}%\' '; Warning: mysqli_stmt::bind_param(): Number of variables doesn't match numbe

MYSQL: Create Unique ID based on Another Column

If I have the following column in database: Email [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] I would like to ALTER

Difference between SYSDATE(),NOW(),CURRENT_TIMESTAMP,CURRENT_TIMESTAMP() in MySQL? [closed]

As per my knowledge, SYSDATE(), NOW(), CURRENT_TIMESTAMP, and CURRENT_TIMESTAMP() in MySQL are synonyms for one another. They all returns

MySQL Filter JSON_CONTAINS Any value from Array

I have a JSON field in a MySQL database that contains values like [1,3,4,7]. I would like to be able to easily supply another array from a PHP variable and det

Case sensitive search in Django, but ignored in Mysql

I have a field in a Django Model for storing a unique (hash) value. Turns out that the database (MySQL/inno) doesn't do a case sensitive search on this type (VA

Sync AWS Elasticache(Redis) to MySQL Database Table

I am using AWS Elasicache(Redis) using PHP & MySQL for different caching purposes that are mentioned below Reducing the load on MySQL Session Handling Datab

How to control the order in which JPA entities are created on Spring Boot App initialization?

How to control the order in which JPA entities are created on Spring Boot App initialization, when we use H2 or MySQL sometimes we feel the child table is creat

How can I use mysql table as a unique key generator in Spring Boot JPA?

I want to generate unique keys at run time across regions and the key generation will be owned by master region. I will have one table with one column(key) with

ER_CON_COUNT_ERROR: Too many connections error in node-mysql

I'm a node beginner. Following is the code that I'm trying to execute using node mysql but it keeps giving me this error: error connecting: Error: ER_CON_COUNT

Can't connect to MySQL via PHP "Name or service not known"

I have a website, which sends input data with AJAX via a PHP script to a MySQL database. The JavaScript/AJAX part is working but the PHP script doesn't get exec

Mysql : How to run heavy analytical query at real time

I am running a crm application which uses mysql database. My application generating lots of data in mysql. Now i want to give my customer a reporting section wh

Filter rows from table 1 with table 2 info

I have 2 tables. One table listing results of a run and a 2nd table with timestamps. table1 (not sure how to add another column to the table but table 1 has an

Form Validation and Submission to database

I am working on a project that has a FORM which should VALIDATE itself and then submit the data to the MySQL Database. But I am facing an error. This is the f