Category "mysql"

how to see if database exists with PDO [duplicate]

So I recently decided to switch to PDO due to the mysqli prepared statement complexity and irregularities. This was my mysqli function to test

How to solve MySQL error which occurs while loading image

When I am opening a local connection in MySQL, an error occurring while loading image search_sidebar.png.How can I solve this problem in MySQL? I have attached

Update database table through jsp to jsp

View.jsp this jsp to fetching the data from the database. <form method="post" action="updatedemo.jsp"> <table width="50%" border="1" align="center"

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

From PHP I would like to call a stored procedure in MySQL. The procedure takes input and output parameters -- not "INOUT" parameters. For a simple example, sa

How to run Sequelize migrations inside Docker

I'm trying to docerize my NodeJS API together with a MySQL image. Before the initial run, I want to run Sequelize migrations and seeds to have the tables up and

Endless loop in mysql_secure_installation

After installing mysql-server, I did sudo mysql_secure_installation in order to secure the server deployment. I indicate that I would like to setup VALIDATE PA

how to rename foreign key in Laravel

I want to rename the foreign key in Laravel. This is how, I have created it: Schema::create('holidays', function (Blueprint $table) { $table->increments(

Django query for latest version of a object

I am trying to write a query in Django but I'm not sure whats the best way to write this. Also assuming that the database is mySQL. This matters if distinct i

I have to search for all city name starting with vowel words but array pattern is not working for MySQL

Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. select distinct(city) from station where c

MySQL: Database design for procedure flow

It's something like knowledge-based system. For example: When a user go to first page, let's call it "How Can I Help You With?" There will be 4 options: In ca

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