Questions tagged as 'mysql'

1
answer

Query a field formatted datetime year to second, asking to bring only today's records?

I would like to know how to fetch a date record, but bring this dat_entrada only with the current date? Here is the query: select a1.cdg_filial Filial, a1.cdg_fornecedor Fornecedor, a2.dcr_fornecedor NomeFornecedor, a1.nmr_d...
asked by 27.10.2018 / 01:53
2
answers

Problems creating a foreign key

Personal I need to create a relationship between the attendance table and the category table, but every time I try it it gives the error 1215 can not add foreign key. What am I doing wrong? Both tables are empty. CREATE TABLE 'atendimentos' (...
asked by 26.10.2018 / 19:38
0
answers

Quick way to search first record

I'm doing the following query in MySQL: select id from positions where device_id = {$device_id} and p1 IS NOT NULL order by time desc limit 1 But the query is taking a long time, since the table in question is giant (90GB). The columns...
asked by 25.10.2018 / 18:55
0
answers

MySQL DUMP COMMAND in VB.NET

Good night guys I need to give this command in VB.NET SHELL but I can not do it already I tried 3 hours I read many things and I can not think outside the box. Shell("CMD.exe /c cd \ & cd Program Files & cd MAPS & cd SERVER MANAGER...
asked by 02.11.2018 / 22:05
1
answer

Edit document with database information and open print dialog - PHP

I'm developing my CBT, basically I have a document with fields that are populated with information from my database, I'm doing this with PHP's 3DOCXTYPE, however I need it right after the documents are edited with the data to open a dialog to th...
asked by 01.11.2018 / 00:40
1
answer

Is it possible to use two identical id's in the same table?

I have a situation that I need to ask a question. I have a table as below: CREATE TABLE confrontos( id_confrontos INT AUTO_INCREMENT NOT NULL, dt_confronto DATE NOT NULL, id_estadios INT NOT NULL, ***id_clubes*** INT NOT NULL...
asked by 24.10.2018 / 16:30
0
answers

Send multiple radio in a form to the database

I need to create an input type="radio", where there will be several searches and will store the responses in the database according to the selected option. How could I do to enter all the search responses in the same table? Below is HTML c...
asked by 24.10.2018 / 20:08
2
answers

Sum of fields filled in within SELECT itself

I have an SQL query in the following format: SELECT XXXX AS duracao, calcula_horas_manutencao({data_inicio_f}, {data_final}, contrato.id) as horas_manutencao, calcula_horas_sistema({data_inicio_f},{data_final}, contrato.id) as horas_s...
asked by 05.11.2018 / 18:57
0
answers

How to write specific XML tags in PHP to MySQL

I'm reading a XML in PHP to write to MySQL , the XML is PagSeguro , I'm already saving some data as the head of the request, but the client wants the purchase information be available in the buyer area on the site even...
asked by 24.10.2018 / 22:38
1
answer

Intersection of same table, auto relationship, mysql with INNER JOIN

Hello, I'm doing a facebook clone database. I have two tables, one of users and another friendship. The friendships table is a self-relationship of users as shown in the picture. This Friendship table contains the IDs of each user and n...
asked by 24.10.2018 / 22:14