Questions tagged as 'mysql'

1
answer

Calculation function with dynamic cursor

I'm trying to create a database function that when I receive a parameter value that contains a certain value it creates a cursor with the specific table. Follow DELIMITER $$ drop function if exists 'fn_calculo_sla'; CREATE FUNCTION 'fn_ca...
asked by 30.11.2017 / 18:49
1
answer

How to do a ranking with SQL?

Well, I have a "single votes" table that receives a "BOOLEAN" value in the columns "single vote1", "single vote2" and "single vote3", where 1 means that the person voted in that uniform and 0 otherwise the logical image of the table: Withthisco...
asked by 17.12.2017 / 15:20
1
answer

BLOB column 'on' can not have a default value (default)

When trying to keep a column as null, mediumText , and add a value 'as defined', it returns:    BLOB column 'over' can not have a default value Why can not I? What are the implications of this? How can I resolve this to allow an opt...
asked by 21.11.2017 / 18:06
2
answers

Select on the bank using "like"

I'm trying to make a select in the mysql database, but I'd like to use like , which should get the value of a java variable. How can I make this interaction? public void returInfoClient(userClient) { Connection mConn = (new Connecti...
asked by 21.11.2017 / 11:45
1
answer

Return "alert" if an IF is not executed

How can I check if an if was executed and if it did not display an alert? See the example: if ($newtime!=0) { $qryupd = "update registration set dados=" . $dadosnew . " where id=$id"; $result2 = mysqli_query($db, $qryupd); if (!$re...
asked by 21.11.2017 / 02:20
2
answers

Difficulty in recovering BRANCH information given a PRODUCT, many-to-many relationship

I recently started my studies in the area and I have a difficulty in the code. I need to display the data as follows: Product code Product class Product Description Name of the branch where you have the product Availability (if it...
asked by 22.11.2017 / 00:24
2
answers

Inserting data in sql after validation

I need to perform a validation where I can only enter the registration of a race in the database if the id of the driver and the user are present in their respective banks. What is the best algorithm to handle this situation? Follow...
asked by 04.02.2018 / 20:57
1
answer

SELECT on a parent table where ALL children are in the same situation - MariaDB / MySQL

I need to make a select in a parent table, where all the children in this table NEED to be in the same situation. For example: In the parent table I have the following fields: pai_id, pai_nome In the child table I have the follo...
asked by 12.11.2017 / 02:33
1
answer

Update table with the highest value of another table in MySQL

I have a table called officials , with the following fields and values: nome salário a 10 b 100 c 30 d 40 I have a second table called official_more_caro , with the same fields as abov...
asked by 14.12.2017 / 01:14
1
answer

Which database connection is best? [duplicate]

I started working and I'm updating the company system, it currently uses this connection: $link = mysqli_connect("0.0.0.0", "teste", "teste", "teste"); mysqli_set_charset($link, "utf8"); if (mysqli_connect_errno()) { printf("<br>...
asked by 23.12.2017 / 21:50