Posts by Matheus Ribeiro • 4,942 points
219 posts
-
0
votes1
answer40
viewsA: Error query PDO
I think it would be something +/- like this, you can concatenate text with text and not text with object... $import = "UPDATE t SET "; if(a <> ""){ $import .= "teste2 = '$a', teste= '$b' "; }…
-
0
votes2
answers54
viewsA: Getting id wrong
Missed you calling the method autenticationLogin to feed its variable idReceived class SenderPost private AutenticaLogin auth = new AutenticaLogin(); public void connect() throws MqttException,…
-
1
votes2
answers448
viewsA: How to return empty value?
How your query can return a value null, treat her return with the ISNULL or COALESCE setting a value 0, which should solve your problem. COALESCE(value, default) The ISNULL and the COALESCE return…
sql-serveranswered Matheus Ribeiro 4,942 -
4
votes1
answer113
viewsA: Sum seconds, minutes and/or hours in field date time
I think what you’re looking for is this =F2 + VALOR.TEMPO("02:00:00") If your Excel is in English you only need to see the equivalent method.
excelanswered Matheus Ribeiro 4,942 -
0
votes1
answer284
viewsA: PHP Mysql error - mysql_num_rows()
Follow this example here, because I think you forgot the connection and without it nothing will be returned in your query... Example #1 Example mysql_num_rows() <?php $link =…
-
1
votes1
answer30
viewsA: Problem recovering firebase values for list
The names of your property class listItemSalvo are totally different from your firebase database, only the field userName is correct, so only it is coming filled in... Your target list class looks…
-
1
votes1
answer33
viewsA: Query mysql in phpmyadmin
See if that solves your problem update t1 set t1.carro = t2.carro from tabela1 as t1 inner join tabela2 as t2 on t2.id = t1.tabela2_id I used as an example this answer EDITED UPDATE tp531710 t1…
-
2
votes1
answer720
viewsA: How to add sql values in column
Try it like this Select Max(PS.PatSldBemValDepAcum) ,Sum(PS.PatSldBemValDep) PatSldBemValDep From Pat_Saldo_Bem as PS With(Nolock) Where PS.EmpCod LIKE '%01.14%' And PS.PatBemCodRed = '0000351' And…
-
0
votes1
answer74
viewsA: how to leave a folder set for when to save? and a folder set to open files?
You can validate the path after the person select the file in this way OpenDialog1.initialDir := 'C:\Seu\caminho\busca\'; SaveDialog1.initialDir := 'C:\Seu\caminho\salvar\';…
delphi-10answered Matheus Ribeiro 4,942 -
1
votes1
answer143
viewsA: Left Join Slow on Firebird 2.0
In your case to improve performance you will have two options 1st Create an index for your table, with this may improve well CREATE INDEX VENDAS_IDX1 ON VENDAS (FATURA); 2nd Modify the structure of…
-
1
votes2
answers86
viewsA: Does PDO use DBMS syntax or do they all work?
According to this "Article" [...] PDO, does not generate SQL commands dynamically, so, no use you use some SQL command specific to SQL Server and then switch to Mysql. In this case you would need to…
-
2
votes2
answers123
viewsA: Query to return the first record with specific values
A very simple way for you to unify is to do it this way SELECT * FROM users WHERE gender LIKE '%M%' ORDER BY id DESC LIMIT 1; UNION ALL SELECT * FROM users WHERE gender LIKE '%F%' ORDER BY id DESC…
sqlanswered Matheus Ribeiro 4,942 -
2
votes1
answer47
viewsA: Database , event or routine ? would work?
You can create a Trigger for your table, as below: CREATE TRIGGER `partidas_before_insert` BEFORE INSERT ON `partidas` FOR EACH ROW BEGIN if(new.aceitou = 2)then if(new.idvencedordesafiante =…
databaseanswered Matheus Ribeiro 4,942 -
2
votes1
answer35
viewsA: How not to repeat data in this query
There in your script you used MAX(PY.DATEPAYMENT) but did not remove the same from the GROUP BY... And there’s another column that could be a problem SEQUENCE, but with this field you did right,…
-
1
votes1
answer114
viewsA: Sort query by Mysqli relevance
You would have to do something +/- like this: SELECT `id`, `titulo`, `foto`, `descricao`, `slug`, `data`, '' as `local`, MATCH (`titulo`, `descricao`) AGAINST (?) AS relevance FROM `twd_noticias`…
-
3
votes1
answer90
viewsA: Using Case or if
You can use how many CASE want in your Script, it may not get very practical, but can... From what I understand, that’s what you want: SELECT cp.idprocesso ,cpv.descricao ,cpv.valoratual ,(CASE…
-
3
votes1
answer28
viewsA: Add open plots with Join
That should solve, missed you inform the group by select c.nome_cliente ,SUM(CASE WHEN p.pagamento is not null THEN p.valor ELSE 0 END) as 'PAGO' ,SUM(CASE WHEN p.pagamento is null THEN p.valor ELSE…
-
4
votes3
answers82
viewsA: Sequenced array within dropdown
Try something +/- like this <datalist class="" id="browsers" > <?php $x = 0; // No lugar de 10 coloca o tamanho máximo retornado na sua busca while ($x <= 10) { echo "<option value="…
-
1
votes2
answers389
viewsA: Sum the value of the column by grouping monthly and by product
Test this script here and see if it works according to what you need SELECT Product ,CAST(YEAR(FirstDate) AS CHAR(4)) +RIGHT('0' + CAST(MONTH(FirstDate) AS VARCHAR(2)), 2) AS PERIODO ,SUM(License)…
-
0
votes2
answers305
viewsA: I can’t write data to my firebase
At a glance here... The firebase site has great documentation, read it carefully that you will be able to do what you want. According to this link you have to do so service cloud.firestore { match…
-
2
votes1
answer58
viewsA: Query using WHERE
If you want to find all the records where the field setor has certain number you would have to do so: Note: Understanding that your field is Varchar or some other equivalent to the type of text…
-
1
votes1
answer45
viewsA: I cannot write data to a txt file
Try this way qr.ParamByName('mes').AsString:= edmes.Text; qr.ParamByName('ano').AsString:= edano.Text; qr.Open; try AssignFile(arq, 'relatorio.txt'); Rewrite(arq);…
delphianswered Matheus Ribeiro 4,942 -
3
votes2
answers406
viewsA: Select dates that are not in the table
See if this script can help you: WITH RECURSIVE DATAHORA AS( SELECT 1 AS id ,CAST(@PRIMEIRO_DIA AS DATE) as tempo /*Aqui tem que ser assim -> '2018-08-01' sempre o primeiro dia do mês que você…
-
0
votes0
answers125
viewsQ: Mysql connection via Ipv6
How can I connect to mysql using Ipv6? I am using a Debian Linux Virtual Machine (VM) and am trying to connect via prompt When I try like this: mysql --host=9999:9999:9999:1:xxx9:x999:2b23:ccab…
-
0
votes1
answer177
viewsA: Connect to Cloud SQL via PHP hosted on Compute Engine
I decided to change the connection string as follows: <?php function getConnection(){ try { {GCSQL IPv4} {Nome da conexao da instância} {Nome banco} $connection = new…
-
-1
votes1
answer177
viewsQ: Connect to Cloud SQL via PHP hosted on Compute Engine
How do I connect to an instance of Cloud SQL through a php file hosted on a Compute Engine VM? • I have a Mysql instance in Cloud SQL called bd-vendas and in it I created a bank called vendas. • I…
-
0
votes1
answer459
viewsA: External connection to sql server by android application, C# xamarim
In the case of mobile applications the database connection is slightly different from the one made with desktop applications. For you to "chat" with the database through an application you need to…
-
6
votes2
answers165
viewsA: How to do a double "Update" in Mysql
Your SQL should look like this: update itens set prateleira = 1 ,enviar = 1 where abs(DATEDIFF(now(), str_to_date(entrada,'%Y-%m-%d'))) < 30 In an UPDATE you should separate the fields by ","…
-
1
votes1
answer1891
viewsA: Perform two COUNT with INNER JOIN
Try these two ways, maybe it’ll help you or a light: SELECT co.acesso ,c.num_corr ,u.num_user FROM conta co LEFT JOIN (select cod, count(cod) as num_corr from corretor) c ON co.id = c.cod LEFT JOIN…
-
0
votes1
answer38
viewsA: I can’t get the date on the chart
Your select must be so: SELECT h.h_dia FROM hh h WHERE cast(h.h_dia as date) = '2018-06-21' GROUP BY h.h_dia; When the field is date and time, if you put in the filter only the date it will…
-
0
votes2
answers60
viewsA: Calculate total orders and total orders for the current month with Mysql
To bring the total order of each user in the current month, try this way: select name ,count(*) as total from pedidos where Month(data_criacao) = Month(CURRENT_DATE()) and Year(data_criacao) =…
mysqlanswered Matheus Ribeiro 4,942 -
2
votes1
answer232
viewsA: How to know if a button has been clicked? Xamarin Forms
Assuming you are developing the visual via XAML... In your XAML use <Button Clicked="OnClick">Button</Button> And in your codebehind private bool BotaoClicado = false; public void…
-
1
votes1
answer72
viewsQ: PHP - Uploading multiple images does not work
I am implementing a Drag and Drop scheme in my project, as in the example below: var holder = document.getElementById('holder'), tests = { filereader: typeof FileReader != 'undefined', dnd:…
-
-1
votes2
answers144
viewsA: How to treat an empty entry?
Try to use the Double.TryParse(S, Result); //Botão que transforma os dados em variáveis e passa para a página de resultados private async void Handle_Clicked(object sender, EventArgs e) { class2 =…
-
0
votes2
answers138
viewsA: group columns in mysql
See if it suits you: with pontuacao_times as( select time1 as time ,pontostime1 as pontos from Sua_tabela union all select time2 as time ,pontostime2 as pontos from Sua_tabela) select time ,pontos…
-
2
votes2
answers2934
viewsA: Update using values contained in another table
Guy unfortunately FIREBIRD does not accept update with Inners... You would have to do something +/- like this update produto set vlrprecocusto = valor; where codproduto in (select codproduto from…
-
3
votes2
answers1158
viewsQ: Create an image gallery
I am starting a project and would like to create a page with a gallery as in the scheme below: Website that owns the Gallery So it seems the images are made available by lines, only I was able to do…
-
2
votes3
answers255
viewsA: Calculate percentage between two MYSQL dates
Try something like this select ((count(if((classificacao = 'vermelho'), 1, 0)) / count(classificacao)) * 100) as perc ,classificacao from questionario where data BETWEEN '".$_POST["datainicial"]."'…
-
1
votes1
answer566
viewsA: Webbrowser from Delhi
As far as I know there’s no way to make improvements on it... A good alternative is to use Chromium Cef4delhpi it is an Opensource project from google and is a very good browser. Chromium works well…
delphianswered Matheus Ribeiro 4,942 -
0
votes3
answers1024
viewsA: Handling of sql temporary tables in Delphi
Delphi querys only connect directly to the database they do not store temporary data. To do what you want to use Tclientdataset (Delphi 7) or Tfdmemtable (Delphi XE5+) In case you will not deal with…
-
1
votes1
answer32
viewsA: B.D error with application doors closed
I do not know what is your database and do not understand much of wordpress, but... A good practice of programming is whenever you create an object, after using it you destroy the same to thus free…
-
0
votes1
answer117
viewsA: View List of Objects in a Listview - Xamarin.Forms
Add in your listview HasUnevenRows="True" <ListView x:Name="listaDestinos" ItemsSource="{Binding ListaDestinos}" HasUnevenRows="True"> Of a researched before that finds easy A question like…
xamarin-formsanswered Matheus Ribeiro 4,942 -
-1
votes2
answers639
viewsA: Zipping files with the same name inside a folder
Yes it is possible, in case I used Winrar but with zip it works too "C:\Program Files (x86)\WinRAR\WinRAR.exe" a "E:\Backup\foto.rar" "E:\Backup\foto.*" If you use "*" instead of the extension, all…
-
0
votes2
answers462
viewsA: Find out how many are older in Windows Forms app
The way you did, you might need to use an Inputbox, but you can do it this way here: public partial class idade : Form { { int qtdTotal, qtde, id; public idade() { InitializeComponent(); qtdTotal =…
-
-1
votes2
answers116
viewsA: Problem to send values of type 11.50 to SQL Server database
Leave the field on the bench as Numeric(18.2) and try so: Note: I’m not with C# here to test, maybe you need to change something there in the formatting private void button1_Click(object sender,…
-
0
votes2
answers343
viewsA: Combobox slowing form loading winforms C# visual studio data
Try to remove the ORDER BY CIDADE from your select and sort directly in the combo CbCidade.Sorted = true;. If the above hint does not solve, then try the second method Create a city class public…
-
1
votes2
answers254
viewsA: How to close all the Forms I want in C#
You can create a control class to store all the menus that you open, where it will store the menu that was opened and what is your "parent" menu, example: public class MenusAbertos { public Control…
-
0
votes2
answers305
viewsA: How to merge 4 tables into one and show text instead of INT - INNER JOIN
You just need to enter the description of the referent table, so instead p.id_processo you do p.descricao_processo select p.descricao_processo ,t.descricao_tipo ,[...] from processos p inner join…
-
1
votes2
answers1076
viewsA: How to Connect to Database by Reading INI File
This is the way I know how to connect using a FDConnection Change the data according to what you need unit FiredacPooling; interface uses FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error,…
delphi-10answered Matheus Ribeiro 4,942 -
0
votes4
answers327
viewsA: Return results for all months of the interval
If you reverse the table otrs.ticket t2 with the otrs.time_accounting ta2 wouldn’t work? Edited SELECT CAST(SUM(CASE WHEN s2.name LIKE '%Servidores' THEN (ta2.time_unit * 1.5)/60 ELSE…