Skip to content
Advertisement

Tag: mariadb

Laravel/MariaDB: errno 150 “Foreign key constraint is incorrectly formed”

I’m on Laravel 5.4, PHP 5.6, Ubuntu 18.04, MariaDB 10.4.8. When I run php artisan migrate, I get: I’m trying to use https://github.com/klisl/laravel-comments. Before trying to perform a migration with this package I had created DB at phpMyAdmin, had configured .env by adding DB name and stuff, had successfully run php artisan migrate, php artisan make:auth and php artisan make:controller

PYTHON – Dynamically update multiple columns using a custom MariaDB connector

While reading this question: SQL Multiple Updates vs single Update performance I was wondering how could I dynamically implement an update for several variables at the same time using a connector like MariaDB’s. Reading the official documentation I did not find anything similar. This question is similar, and it has helped me to understand how to use parametrized queries with

How to use a SQL keyword NOT as a keyword

I am trying to transform a table of data–I want the rows to become the columns, and the columns to become the rows (like a total complete pivot). I am using the method from this answer to do so. If it makes any difference, I am running my own SQL server on a Raspberry Pi using PHPMyAdmin. The table (truncated)

Multiple full joins in one query on multiple tables

I have a database with multiple tables, I wish to show all contents from every table with one query (that I will use later for a research in the database). view of the database I’ve tried with two tables but it returns an error. I’m using 10.4.14-MariaDB version. full join query error Answer One method uses multiple left joins, starting

Select records within 5 kilometers with group by

I have an application that uses coordinates. I want to select records within 5 km that were thrown in the last 5 minutes. How can I do this easiest? I want to write a procedure. The values I will send to the procedure are latitude (float 11,8) and longitude (float 11,8). Example table: I found a query like this but

SELECT statement across multiple tables

First off, I am not an SQL coder. I am trying to select information from 2 different tables in the same database. Table 1 is called trans and has 3 columns: Table 2 is called cust and has multiple columns: The SELECT statement that I’m trying to write will pull data from both tables. I THINK I need to use

Advertisement