Posts by caiocafardo • 1,897 points
132 posts
-
0
votes0
answers11
viewsQ: removeClass where the internal link is a space
I have the following HTML: <div class="segura-li"> <li class="classe-li"> <a href="link1">texto</a> </li> <li class="classe-li"> <a…
jqueryasked caiocafardo 1,897 -
1
votes1
answer30
viewsQ: Select in Mysql sorted by the WHERE condition
I have a database in Mysql designed like this: id, nome At the following values: 1, Banana 2, Maçã 3, Uva 4, Laranja I have a select like this: select * FROM table WHERE id = 2 OR id = 1 OR id = 4;…
-
1
votes1
answer20
viewsQ: Mysql KURDATE with month
In Mysql if I want to search only dates that are in the current year, I do so: WHERE dia = year(CURDATE()) But I’ve been trying to find dates that are in the same month as the current one: WHERE dia…
mysqlasked caiocafardo 1,897 -
0
votes1
answer23
viewsA: remove() with jquery id with ()
I managed to sort it out like this: var nomeArquivoApaga = nomeArquivo.replace('(', '\\('); var nomeArquivoApaga = nomeArquivoApaga.replace(')', '\\)');
jqueryanswered caiocafardo 1,897 -
-1
votes1
answer23
viewsQ: remove() with jquery id with ()
In the HTML I received there are many Divs like this (or almost like this): id-name-(24498765); When running this in jquery: $('#'+'nome-do-id-(24498765)').remove(); I get the following error:…
jqueryasked caiocafardo 1,897 -
0
votes1
answer27
viewsQ: GROUP BY TIME type field in Mysql
In Mysql I have a table, one of the fields is of type TIME (TIME field). When making an appointment like this: SELECT hora FROM tabela GROUP BY hora Nothing is returned if I give GROUP BY in any…
mysqlasked caiocafardo 1,897 -
-1
votes1
answer120
viewsQ: Make an encrypted Mysql database connection
To make a connection to the Mysql database use this code in PHP: $host = "host"; $usuario = "usuario"; $banco = "banco"; $senha = "senha"; $pdo = new PDO('mysql:host='.$host.';dbname='.$banco,…
-
1
votes2
answers47
viewsQ: Get audio id played
I need to get the audio ID that the play user, I figured something like this would work: document.addEventListener('play', function(e){ $(this).attr('id'); }, true); <script…
-
0
votes1
answer27
viewsQ: Feed div that were dynamically created
In Jquery I am creating Ivs dynamically like this: var totalLoop = 2; var escreveReceitas = ''; for (i = 1; i <= totalLoop; i++) { escreveReceitas += '<div class="produtos_titulo"…
jqueryasked caiocafardo 1,897 -
0
votes0
answers22
viewsQ: Do texts loaded via Jquery harm SEO?
I’m developing a website, but for technical reasons I won’t be able to use a database and no server side language. As the system will have MANY posts (more than 500), I am loading this via Jquery,…
-
0
votes0
answers29
viewsQ: Register in database when user closes browser window
I am developing a system that needs to have recorded the time that the user was logged in to the site. When he login I register in Mysql the login time and his ID, the problem is at the time he…
-
1
votes1
answer115
viewsQ: Redirect domain only using the BR Record
I have a client who is from Japan, the entire application will run on his server, from Japan. I purchased the domain .com.br in Registro BR, and in the location of the DNS Zone (within Registro BR)…
-
0
votes1
answer128
viewsA: Background-image does not repeat
The problem is in class .card-img-overlay, it holds all the content and has a position: absolute; A class with position: absolute; does not influence body size.…
-
1
votes2
answers28
viewsA: Play an audio starting in 10 seconds
I got: var minhaMusica = new Audio(); minhaMusica.src = 'musica.mp3"; minhaMusica.currentTime = 10; minhaMusica.play();
-
1
votes2
answers28
viewsQ: Play an audio starting in 10 seconds
I’m controlling some audios on a website and I’m needing some specific audios to start on second 10, so far it’s like this: var minhaMusica = new Audio(); minhaMusica.src = 'musica.mp3";…
-
0
votes1
answer19
viewsQ: Delete an entire class and everything in it from an HTML loaded via ajax
I have two pages in HTML: index.html: <div class="topo"> topo </div> <div id="viewdata"> <div class="conteudo"> Essa é a home </div> </div> html news. <div…
-
0
votes0
answers38
viewsQ: Change URL and audio remain playing
I am developing a site in PHP and Jquery where at the top of the site (present on all screens) the user will be able to click play and listen to a streaming of a live radio. The problem is that when…
-
1
votes2
answers119
viewsQ: Mysql group by month and year between dates
I have a table called agenda in Mysql like this (the date is in the database in date format, I put in Portuguese format just to make it easier the example): I need a query that lists the months and…
mysqlasked caiocafardo 1,897 -
0
votes1
answer260
viewsQ: Redirect 301 with web.config
I’m updating a website, and the Urls will change. So, I need to make a redirect 301 with web.config, but I couldn’t. Below the code I built: <configuration> <location path="site-antigo">…
-
1
votes1
answer41
viewsQ: Width auto with the second element filling the remaining space
I have the code below: .segura{ width: 100%; height: auto; display: block; margin: 0 auto; } .label{ width: 90px; height: 20px;; float: left; background-color: #6fccdd; } .campo{ width: calc(100% -…
cssasked caiocafardo 1,897 -
0
votes1
answer41
viewsQ: Site in 2 language without changing the URL, will I have problems with SEO?
I am developing a site in 2 languages in PHP, the first time the user accesses, it takes the browser language with HTTP_ACCEPT_LANGUAGE, if the user changes language, except this choice in a…
-
0
votes1
answer28
viewsQ: Show quotes coming from Mysql
In Mysql I have a table with the following data: “Cavalo dado não se olha os dentes”, disse a professora <br> Segunda linha I’m taking this field like this: $sql = $pdo->prepare('SELECT…
-
-1
votes1
answer44
viewsQ: Viewport width disregarding body scrollbar
I have an HTML saying that the scrollbar will be 8px, so: ::-webkit-scrollbar { width: 8px; } In this HTML will have an image gallery, where each photo will occupy 20% of the body width, so I did…
-
4
votes1
answer149
viewsQ: CURDATE() with day and time
In Mysql I have a table with field type DATETIME, with this value: 2019-08-01 15:30:00 For control, today is day 01/08/2019 15:05:00 I want to do a query that only shows if the date in the database…
-
0
votes3
answers470
viewsQ: Real value (R$) for Javascript number
I made a script to turn a field that receives real value (with . and ,) to number, the problem is that it doesn’t work very well. Put this value in the field R $ 123.456.789.123,11 and see the…
-
1
votes1
answer142
viewsQ: In Mysql group by week does not list correctly
I have in Mysql the table acesso, that saves all client accesses to a system, it saves user id (id_usuario) and the day (dia) access. I am making a query to check the weekly accesses, so: SELECT…
mysqlasked caiocafardo 1,897 -
0
votes3
answers221
viewsA: Mysql LIKE cannot be found by full name
I ended up searching for REGEXP: $nome = "Treinamento Da Venda à Entrega (Teste)"; $nome2 = str_replace(" ", "|", $nome); $nomeBusca = "SELECT id FROM tabela WHERE nome REGEXP '".$nome2."'";…
-
1
votes3
answers221
viewsQ: Mysql LIKE cannot be found by full name
I have a search system in Mysql + PHP, it does the search like this: $nome = "Treinamento Da Venda à Entrega (Teste)"; $sqlPost = "SELECT id FROM tabela WHERE nome LIKE '%$nome%'"; $resultPost =…
-
2
votes2
answers88
viewsQ: VARCHAR FOR NUMBER
I have a column (value) in MYSQL in varchar, and in it I store whole or broken numbers, like this: 1.1 2 3.99 4.2 2.345 In the query I need to know when a number is (greater or equal) and (less or…
-
0
votes1
answer12
viewsQ: Using draggable error when calculating the percentage
I’m using draggable from Jquery UI to do a drag effect (drag), the difficulty is in calculating, from 0 to 100, the drag position within the bar. Look what I’ve done: $('.drag').draggable({ axis:…
-
0
votes0
answers51
viewsQ: Space below div with image
In HTML and CSS is appearing a white space below the image, see the example, the error is this white space between the image and the black box .div1{ width: auto; height: auto; display: block; }…
-
1
votes1
answer38
viewsQ: Fetch ID value using preg_match_all in PHP
I get a string in PHP and need to fetch the values of Ids, can be 1, how can be 100 ID’s, how to do? I tried something like this: $texto = 'Nome1 <span id="indicado-b">Camila</span>…
-
0
votes2
answers133
viewsQ: How to move the cursor to the end of content with span of a contenteditable element after Focus
I am making an input text using contenteditable, what I need is a Javascript button that when you click Focus in this field, I even managed, but after that I need to put the cursor at the end of the…
-
0
votes2
answers28
viewsA: List in Mysql tables that do not have AVG
The problem was in GRUP BY, I changed to group to LOCAL id, like this: SELECT *, AVG(local_nota.nota) AS 'nota' FROM local LEFT JOIN local_nota ON local.id = local_nota.id_local GROUP BY local.id…
mysqlanswered caiocafardo 1,897 -
0
votes2
answers28
viewsQ: List in Mysql tables that do not have AVG
I have two tables in Mysql like this: LOCAL id | nome NOTA_LOCAL (user notes for each location) id | id_local | nota I’m listing the locations and already showing the average of notes that each…
mysqlasked caiocafardo 1,897 -
0
votes2
answers64
viewsQ: How to count weekly single accesses in Mysql
I have this query in Mysql to check the unique accesses to a system of mine: SELECT COUNT(DISTINCT id_usuario) AS total, dia FROM acesso WHERE (dia BETWEEN '2018-01-21' AND '2019-01-21') GROUP BY…
mysqlasked caiocafardo 1,897 -
0
votes1
answer197
viewsQ: How to take a specific value of an object?
I receive this object in PHP (I could see the values with print_r): stdClass Object ( [id] => 1 ) 1 Wanted to echo only id value (1), how to do?
-
0
votes2
answers183
viewsA: Change button link according to radio
You need to handle change by name $('input[type=radio][name=gender]').change(function() { if (this.value == 'male') { $('.LinkBotao').attr('href', 'http://www.google.com'); }else if (this.value ==…
-
2
votes2
answers558
viewsQ: Check values within a JSON
In Javascript I’m getting a JSON like this: function checaEad(){ var urlEad = 'http://urljason.json'; $.getJSON(urlEad, function(data) { console.log(data); }); } He returns it to me:…
-
0
votes2
answers210
viewsQ: SELECT calculating note average in Mysql
In a training system I have two tables: TABLE nota_local: id id_local nota TABLE local: id nome The table nota_local stores the notes that each user gives to the location where the training took…
mysqlasked caiocafardo 1,897 -
3
votes1
answer335
viewsQ: GROUP BY does not work in Mysql 5.7
Locally I have Mysql 5.6 installed, and this SELECT works smoothly: SELECT dia FROM indicacao GROUP BY YEAR(dia), MONTH(dia) ORDER BY dia DESC Already on the client server, with Mysql 5.7 this same…
-
-1
votes1
answer309
viewsQ: Mysql update only one line field
In Myssql I have a table like this: I receive in a PHP via POST id of the table and which photo I must clean from the database: id= 1 foto = aaa.jpg With UPDATE need to leave the table like this:…
-
0
votes1
answer102
viewsA: Mysql order by hour
I ended up getting it for whoever has the same doubt I do: SELECT COUNT(id) AS total, dia FROM acesso GROUP BY HOUR(dia) ORDER BY HOUR(dia) ASC is ORDER BY HOUR…
-
0
votes1
answer102
viewsQ: Mysql order by hour
In Mysql I have the following table: 2018-06-28 12:10:26 2018-06-25 11:10:26 2018-06-21 14:10:26 2018-06-31 00:10:26 2018-07-28 01:10:26 2018-07-29 09:10:26 Are the login days of each user (have the…
-
2
votes1
answer66
viewsQ: 2 Groupby in a Mysql query
In Mysql I have a login table with the field day and User ID: 28-01-2019 - a 28-01-2019 - a 29-01-2019 - a 29-01-2019 - b 29-01-2019 - b 30-01-2019 - a 30-01-2019 - b 30-01-2019 - c What I need is…
-
3
votes4
answers190
viewsQ: Divide a sentence into 2
In PHP I get a phrase from the database, example: Nome do produto teste cadastrado no banco I need to split her in two like this: Nome do produto teste cadastrado no banco I mean, as much as half as…
phpasked caiocafardo 1,897 -
1
votes3
answers98
viewsA: With LEFT JOIN list the NOT IN
I got it that way: SELECT usuario.id AS id_buscado FROM usuario LEFT JOIN usuario_gerenciamento ON usuario.id = usuario_gerenciamento.usuario_id WHERE usuario_gerenciamento.usuario_id IS NULL AND…
-
2
votes3
answers98
viewsQ: With LEFT JOIN list the NOT IN
In Mysql I have the table usuario, with the fields ID and CPF: I received from the client a list with some numbers and what I need: See which of these users is NOT in the table…
-
0
votes1
answer26
viewsQ: Group By show when not in the table
I have the table below in Mysql: I wanted to search the users that has the color BLUE but does not have the color GREEN, IE, in this table would list me user 3 only, I tried so: SELECT * FROM…
-
0
votes1
answer412
viewsQ: mysql select order by starting with today’s date
I have this appointment that seeks birthdays of the month: $mesHoje = date("m"); $sqlAni = $pdo->prepare('SELECT * FROM aniversario WHERE MONTH(dia) = :mesHoje ORDER BY dia ASC');…