Questions tagged as 'mysql'

1
answer

How to add different totals by columns in MySQL?

Good morning I have the following table in MySQL : id | pais | categoria 193 | BR | A 188 | BR | A 133 | BR | B 145 | BR | C 124 | CA | A 165 |...
asked by 21.02.2018 / 04:53
3
answers

Conditional clause AND Mysql

This query receives two parameters, what I intend is that the second conditional participates in the query only if the value it receives is greater than 0, that is to say that AND fk_id_b = ? is evaluated only if its value is greater than...
asked by 22.01.2017 / 22:57
1
answer

Show two data of the same table in different INPUT

I have a table ARTICLES that has two fields: the first Article (whole number) the second Description (varchar) In my system I show a select with all the records of the table ARTICLE By selecting I'd like to: A textbox that I have...
asked by 19.01.2017 / 04:56
2
answers

Clone database in MySQL

I was cloning a database in MySQL using the following command: $user@host: mysqldump -u root -p MyOriginalDatabase | mysql -u root -p MyDatabaseCopy And the output was the following:    Enter password: Enter password: I ente...
asked by 16.01.2017 / 22:02
1
answer

MySQL query from Python

I'm looking for a way to make a query to MySQL from Python, for this I'm supporting the documentation official . The problem is that although I can connect and do the query without problems, I am unable to go through the results, look for the d...
asked by 01.01.2018 / 06:51
1
answer

validate user attempts when logging in

I'm trying to validate an entry login to verify a user's attempts to login. If this completes 3 unsuccessful attempts, then the account is deactivated (In my database, in the user table, the user's status changes to inactive) This is my code:...
asked by 26.06.2016 / 18:30
1
answer

Timestampdiff does not work in Clause Where

I'm doing a query to the database and I want to show me only the records in which the difference between the query time (NOW()) and the time of the datetime variable is less than 60 minutes ... (which shows everything that is more than on...
asked by 24.02.2017 / 03:46
2
answers

Problems with dynamic select - dependent ajax, mysql and php

I try to create a dynamic / dependent select with ajaxx and this even though it generates return results, I can not give value to the html element. Here the code: <script> // Agarra el ajaxx de país. $(document).ready(function...
asked by 15.12.2018 / 03:33
1
answer

Data from two tables in the same query

I need to show the matching records of two tables, sorted by date. I can show them in the way I show in my code, but of course, first show the data of one table and then the other. I think the necessary thing is to join the two consultations, bu...
asked by 25.11.2018 / 17:34
1
answer

how to get an average in an sql query?

Could you help me solve this doubt I have. I need to show for each blood type that number of employees has it, also showing the total percentage of employees of the company represents that amount. Here the problem is that in percentage...
asked by 23.11.2018 / 01:26