Category "mysql"

Table relationship problem for an competition program (tennis/Padel)

I am trying to make a my first relationally table structure for a tennis/Padel competition program that registers the scores (sets.)of dubbel matches(4players).

How do I make SQL injection is this vulnerable query

I have this query that receives a parameter from user input and I think that I am vulnerable to SQL injection. $query = "SELECT pcode,price,description FROM pro

How to output sql date row to time elapsed

I have table with row id, name, created_at and I want to output the created_at row as timestamp time ago in php

Week date range

There is a table objects, which stores data on real estate objects. Me need to use a query to calculate a new field that will display the date range from Monday

calculating the average of marks from the beginning to this record

i have a table named test with the below structure like this id mark join_id 1 5 1 2 4 1 3 9 1 4 5 2 5 7 2 6 12 2 i want to write a que

SQL GROUP BY and COUNT and conditional SUM with column value

Here is an example of my table. ┌────────┬────────&#

Get specific rows only after comparing with previously added rows on different date

There is a table which has multiple fields including a Date column at which the current record gets updated. Col1 Col2 Col3 Date A X1 Y1 Today B X2 Y2 Today C

I am trying to connect and read data from mysql in node js and react project with clinet and server setup but

**I am trying to connect and read data from MySQL database in node js and react project with client and server setup but unable to get success, here is the code

How do I get a data from one table to another but with calculations?

I have two tables: "Customer" and "Order". The "Customer" table has an attribute called noOfPurchases, and the "Order" table has an attribute called quantity. H

Why does this Sql query shows the possible changes but does not implement it?

So, I want to change the prefix of my tables and the following command shows the possible changes that will take place which seems alright but does not seem to

MS Access ODBC Connection error - "cannot define field more than once"

Does anybody have some insight on why the following error "cannot define field more than once" comes up in ms access when connecting MySQL tables via ODBC? The

How to use Python-Operator % for multiple values?

I'm trying to fill an SQL database with soma data, measured by an bme680. Therefore I'd like to format the measured values like this: print ("Temperatur: %0.1f

how to get weeklytotal and yesterday record in mysql in one table

Hi Everyone i am trying to implement query to get weekly and yesterday data in same table, dummy output i have shared below, if yesterday not exist as per emplo

Resolving 'Illegal-mix-of-collations' MYSQL error in node

I am connecting to a mysql database from node using mysql2 and have been experiencing intermittent illegal-mix-of-collations errors - see this question. The col

How to use multiple databases in Django with an empty 'default'?

I'm trying to make a multiple database project in Django. But I'm having problems to properly migrate my models to the appropriate database. I'm using the 'Writ

Can I replace MariaDB with MySQL in Bitnami MAMP?

I am maintaining an old, large CakePHP project which relies on the JSON database column type. This type is supported by MySQL but not by MariaDB. Changing out t

Do MySQL databases implement Transactions by Default?

I was wondering what happens when several users try to UPDATE a MySQL database at the same time. Went online and learnt about Transactions. Do I need to define

mysql table formatting and infile issue

Each time I go and create my table and then add the .csv file, it keeps not fully loading in all of the data. Below is my code: CREATE TABLE Parts_Maintenance (

Join to another table only matching specific records

I have a table of ports: drop table if exists ports; create table ports(id int, name char(20)); insert into ports (id, name ) values (1, 'Port hedland'),

Index Usage in MySql InnoDb

I wonder that the index usage in Mysql InnoDb Engine. below is simplified example. fields a , b , c , d indexes a(pk) (a, b, d) (composite index) Query Select