Posts by Everaldo Filho • 444 points
15 posts
-
0
votes1
answer76
viewsA: Problem returning data with Mysql PDO
I removed the CASE and the OUTER, being like this: SELECT p.Codigo, p.Descricao, if(gp.CodGrupoUsuario is null, 0, 1) as TemPermissao FROM permissao p LEFT JOIN grupopermissao gp ON gp.CodPermissao…
-
0
votes1
answer173
viewsA: How to work with absolute URL?
Are you programming in PHP right? Then you can create a file called config.php and set the BASE URL on it. Example: <?php define('BASE_URL','http:/localhost/nomedosite/'); And in the other files…
-
5
votes2
answers104
viewsA: Text on image
Use the attribute title example: <img src="caminho.jpg" title="Meu titulo fica aqui"> You also have the alt attribute if the image does not load it will be displayed. Note: Searchers use these…
-
0
votes3
answers2314
viewsA: How to calculate two columns and compare the result with another column?
Try this query: select sum(natureza_operacao = '1' ) as operacao1, sum(natureza_operacao = '2' ) as operacao2, (sum(natureza_operacao = '1' ) - sum(natureza_operacao = '2' )) as resultado from…
-
1
votes2
answers394
viewsA: How to bring two columns with different results
Try it like this: SELECT sum(ativo = 'S') as TotalAtivo, sum(ativo = 'N') as TotalEncerrado FROM projetos WHERE ativo in('S','N')
sqlanswered Everaldo Filho 444 -
1
votes1
answer39
viewsA: Problem while uploading images
Check if your form contains this attribute enctype="multipart/form-data" Thus remaining: <form action="" method="post" enctype="multipart/form-data">…
-
1
votes1
answer82
viewsA: Print separate but same id Divs
See if it works: <script> function imprimir(mesmo){ var conteudo = mesmo.parentElement.innerHTML, tela_impressao = window.open('about:blank'); tela_impressao.document.write(conteudo);…
-
0
votes3
answers789
viewsA: Problem sorting sql with orderby Date in postgresql
Try it like this: select sum(total) as total, datavencimento from ( SELECT sum(con_valoraserpago) as total, to_char(con_datavencimento,'mm/yyyy') as datavencimento , to_char(con_datavencimento,…
-
2
votes2
answers150
viewsA: Query with JOIN in 3 tables
Thus: SELECT l.* FROM livro l INNER JOIN livroautor la on la.idlivro = l.id WHERE la.idautor not in(SELECT a.id FROM autor a);
-
0
votes3
answers6461
viewsA: Exchange CSS classes with simple Jquery function
Try this code: $('.liClassLBV').click(function(){ $('.liClassLBV').not(this).find('span i').removeClass("fa-level-up").addClass("fa-level-down"); $(this).find('span…
-
-1
votes2
answers264
viewsA: Update edits all information instead of just one specific, when I put Where to an edit specifies nothing is edited, what to do?
Simple, you are sending by POST method, and you are trying to get this information by GET so it is not working UPDATE. Like this: $codreg = $_GET['codreg']; As it should be: $codreg =…
-
2
votes2
answers100
viewsA: How to resolve page redirection in form?
Just put false Return at the end of the function, and put the Submit event in the form and not on the example button: $(".cata-lead").submit(function (e){ e.preventDefault();…
-
3
votes1
answer393
viewsA: Error: readdir() expects Parameter 1 to be Resource, Boolean Given
Following the PHP manual, the code can be like this: <?php $dir = "/etc/php5/"; // Abre um diretorio conhecido, e faz a leitura de seu conteudo if (is_dir($dir)) { if ($dh = opendir($dir)) { //…
phpanswered Everaldo Filho 444 -
6
votes2
answers78
viewsA: Search script does not return results or errors
I noticed that in your SQL has an ERROR in the condition used, It is missing to write "LIKE" in the last conditions: where (('card_name' like '%" . $busca . "%') or ('effect_description' like '%" .…
-
3
votes2
answers161
viewsA: Different queries but return values in the same table
Based on the SQL that Walmir passed you works! and also da para fazer utilizando "IF": SELECT Product, SUM(Amount) AS 'Total 2017', CAST(SUM(if(MONTH(RegistrationDate) BETWEEN 1 AND 3 , Amount, 0))…
phpanswered Everaldo Filho 444