Questions tagged as 'mysql'

1
answer

Java with MySQL (JDBC) - Type YEAR

I am having a question on how to write a YEAR type in MYSQL database using a Java application from a TextField, I have already tried to use Date type, but I can not get just the year to write to the YEAR field in the YEAR field. I tried with Sim...
asked by 01.07.2017 / 23:38
1
answer

How to do a Ray calculation in SQL, using MySQL, with two conditions?

Hello, I already do a ray calculation in SQL, using MySQL and PHP, which takes the location of the device (latitude and longitude) and filters the radius according to the location of the device. It's like this (excerpt): (6371 * acos(...
asked by 06.05.2017 / 19:29
0
answers

How to define a minimum time interval between inserts in the database?

I have a submission form, where it adds comments to the database and shows them on the page. The problem is that I want to set the form so that people can only do submissions every 10 minutes. That is, a user can only post a second comment 10...
asked by 06.05.2017 / 15:18
2
answers

Problem with Table UPDATE based on the sum of another table

Greetings to all of the forum! As everyone who starts learning MySQL, we come across relatively simple problems that we can not solve. I created the INFO_PACOTES table that stores packet information that travels on my network. The files ar...
asked by 06.05.2017 / 22:39
0
answers

Play video in mysql BLOB

Hello, I'm creating a site for uploads, and I packed a part, it's not professional I'm just testing my knowledge and training. My problem is the following, I need to make an efficient way for the video blob of the database to be played on mine w...
asked by 07.05.2017 / 22:38
1
answer

PHP does not save form data to the database

I'm starting in PHP and I'm having problems with the following code <?php define("SERVIDOR", "localhost"); define("USUARIO", "root"); define("SENHA", "leonardo"); define("BANCODEDADOS", "estacionamento"); $conecta = new mysqli(SERVIDOR,...
asked by 11.05.2017 / 05:29
1
answer

Sub-Select with MAX / SUM / INNER JOIN?

I need to make a SUM within MAX to return the highest product billing within a summary. I was able to do this: SELECT MAX(Faturamento) MAX_Faturamento FROM (SELECT SUM(P.preco * I.qtde) Faturamento FROM produto P IN...
asked by 01.05.2017 / 17:01
0
answers

On duplicate key Mysql - Last id auto incremet

How do I return the last id auto increment in this case? insert into t1(a, b, c) select d, e, f from t2 on duplicate key update b = e, c = f; I've tried last_insert_id (), but it returns the last id of the table and not the transaction....
asked by 05.05.2017 / 16:57
3
answers

How to use a two-dimensional Array with Javascript (jquery)?

I think my question is too shallow, but I explain the situation in more detail: I already have the code and it works partially follows; $(document).ready(function() { var url = "dominio.com/json.php"; $.getJSON(url, function(result)...
asked by 05.05.2017 / 05:22
4
answers

Help with PHP and MySQL

I have 2 tables; [links] id link clicks Exemplo de Link cadastrado ID link clicks 1 http://www.google.com.br NULL 2 http://www.gmail.com NULL [users] id nome email Exemplo de user cadastrad...
asked by 17.05.2017 / 20:29