Category "mysql"

Does the Laravel `increment()` lock the row?

Does calling the Laravel increment() on an Eloquent model lock the row? For example: $userPoints = UsersPoints::where('user_id','=',\Auth::id())->first();

Group by age ranges in MySQL

We have a date of birth field(type date) and user_id in the table and we want to get count of users group by age based on the date of birth field For e.g. afte

How to process a string as a file to contruct a ZipFile object?

I am currently pulling data from a database with blobs. I retrieve the blob from the database, but I need to parse the text. the ZipFile class takes in files no

How to find next AUTO_INCREMENT value of a table in MYSQL 8

I was using the query below to find the next AUTO_INCREMENT value of table in MYSQL 5.7 SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME

How to reduce Google Cloud SQL instance size?

I have a Google Cloud SQL MySQL 2nd Gen 5.7 instance with 70GB of unused storage. I want to reduce the unused storage of my instance as this is one of the major

Upgrade MySQL on Mac

I did an upgrade of my XAMPP from 7.1.24 to 7.4.2. First I uninstall my XAMPP using uninstall.app, then I install my new XAMPP, then i check my phpmyadmin every

Why select id using other index?

I am using mysql8.0.27, here is my table: CREATE TABLE `test` ( `id` int NOT NULL, `number` int DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `idx_number

how to strip timestamp of +00:00 in sequelize

I am using Sequelize to map objects to my already existing database, in this database they didnt use the auto-generated timestamps, they did their own datetime

Error: Cannot enqueue Query after fatal error in mysql node

I am using felixge/node-mysql. Also I am using express-myconnection which prevents mysql timeout and in turn prevents killing of node server. What I am doing is

How can we use group by keyword on PIVOT table having dynamic column joined with another table or alternative query of Pivot

I have 2 tables named tblDemo and tblSubDemo; tblDemo havve 2 columns _id and _name. tblSubDemo have 3columns, ID,Name, Demo_ID(it is the primary key of tblDemo

how to get clicked value and pass it to another jsp page (integer)

I am working in a project in which I have a Display.jsp page which fetches all the records from mysql database and shows in a table on the page. While I want to

TypeORM column type dependant on database

I have simple entity @Entity() export class File { @PrimaryGeneratedColumn() id: number; @Column({type: "mediumblob"}) data: Buffer; } Which

Error in MySQL when setting default value for DATE or DATETIME

I'm running MySql Server 5.7.11 and this sentence: updated datetime NOT NULL DEFAULT '0000-00-00 00:00:00' is not working. Giving the error: ERROR 1067 (420

i intended to send some information and their value to fill up the columns in the database. Such information are title, image ,description ,and price

echo '<pre>'; var_dump($_FILES); echo '</pre>'; exit; $errors = []; $title = ''; $price = ''; $description = ''; echo $_SERVER['REQUEST_M

MYSQL - Count Query Taking Time

I am running the following query and it's taking more than 12 sec on my local system. SELECT DISTINCT entity_id_0 FROM (SELECT DISTINCT c0_.enti

Add record for each array elements if missing in table

I feel like I need a little push to break through this one. I have this array of players $playerids = ['1', '2', '3', '4'] I have this array of periods $period

Laravel Database Strict Mode

I'm little wonder please help me out. My query is :- Invoice::join('orders', 'orders.invoice_id', '=', 'invoices.id')->groupBy('invoices.id')->get();

Find a record containing all or a part of a list of id of other table in a many-to-many relation on MySql/Jpa?

In my web application, I have 3 tables: TAB A: Recipes (id, name) TAB B: Recipes_Ingredients(id, fk_recipe,fk_ingredient, quantity) Bridge table TAB C: Ingredie

not able to connect to mysql docker from local

I am trying to connect to mysql database from docker image. However it's throwing errors. following is the docker image I am using. https://hub.docker.com/_/

find in set in laravel ? example

I am new in laravel. My query is i need to find out value from comma separated field. Here is my table: tags_value id tags 1 css,html,php 2 php,java,css 3 java