Posts by Gato de Schrödinger • 2,367 points
141 posts
-
4
votes1
answer241
viewsQ: Onkeydown event does not work in full-screen (F11) mode in Chrome
I have a page that has a header. I would like when clicking the F11 button (which leaves the browser in Full Screen mode) the header to be hidden from the page and when I click again, the header…
-
2
votes2
answers116
viewsQ: How to take all the <td> textContent of a table and assign it to an array?
I’m wanting to get all the textContent das td that then inside a tr of a table. However, this should happen when I click on your respective parent TR. These tr are generated in PHP and returned by…
javascriptasked Gato de Schrödinger 2,367 -
2
votes2
answers238
viewsA: Add parameters in JSON array after form serialize
I think this example fits you. //EVENTO PARA QUANDO SUBMITAMOS O FORMULÁRIO DE CADASTRO $('#formulario-cadastro').submit(function(e) { e.preventDefault(); let origem = "pagina-de-cadastro"; let…
-
0
votes0
answers39
viewsQ: What is the difference between MD5, SHA and SHA 2 in MYSQL and which is most recommended for storing information in the database?
I usually store users' passwords via MD5 in the database. Being that I participate in a group, and the staff there said that it is not recommended to use MD5 for storing data in the database, as it…
mysqlasked Gato de Schrödinger 2,367 -
0
votes1
answer221
viewsA: How to send multiple files via AJAX and store them in the database?
I was able to send multiple files and insert them in the database, using the code below. (I believe it is very useful, because I have seen many people with this difficulty) Below is how was the code…
-
0
votes2
answers49
viewsA: Remove class when resizing
Let me give an alternative example to the question, using media queries (CSS) instead of Javascript. Being in charge of the user use or not. <style> /* Para telas até 1024px */ @media only…
-
0
votes2
answers11055
viewsA: What is the advantage of using the ENUM type?
Well, first we have the storage requirements . ENUM uses 1 byte (if it is below 255 values) or 2 bytes (up to 65,535 maximum) Tinyint wave 1 byte (maximum of 255 values) Boolean is a synonym for…
-
3
votes3
answers171
viewsQ: Is there a native Javascript method that returns the sum of the elements of an Array ? How does array_sum() do in PHP
I would like to add the elements of an Array. As the example below: array_soma = [5, 4, 3, 2, 1]; let resultado = metodo_somador(array_soma); //Gostaria que nesse console retornasse o valor de 15…
javascriptasked Gato de Schrödinger 2,367 -
5
votes3
answers4467
viewsQ: How to take part of a String up to a specified character?
I would like a Javascript method that takes part of a String up to a certain point (character) from it. In this case I would specify a character and only be taken part of the String until the…
javascriptasked Gato de Schrödinger 2,367 -
7
votes3
answers603
viewsA: Why is it allowed to delete elements from an array defined as const?
We can declare a variable as constant through the const keyword. But what is a constant ? Once a value has been assigned to a variable that has been declared using the const keyword, its value…
-
4
votes1
answer188
viewsQ: What is the maximum millisecond interval that can be used in the Javascript setInterval?
I would like to know the maximum range that can be used in the method setInterval javascript. I ask this, because I used setInterval the way below and it did not execute. I don’t know if it’s…
javascriptasked Gato de Schrödinger 2,367 -
0
votes1
answer846
viewsQ: Uncaught (in Promise) error Error: Element is not Attached to a Document when trying to generate a PDF of an HTML page
I am trying to generate a PDF of a page made in HTML. This page has a chart created with Chart Js. I would like to click on the button to generate a PDF of the chart. However, clicking the Button…
-
0
votes3
answers4833
viewsA: Decrease size Bootstrap field
Just to complement the answers cited by other colleagues, we can also change the size of the input and select by changing their form-control classes (native Bootstrap class). See the examples below:…
-
1
votes1
answer323
viewsQ: Unwanted line break in PHP output
I have a php code that after performing an instruction, returns a string to AJAX. The problem is that this string is coming out with line breaks that don’t exist. (Both in php and in AJAX return in…
-
0
votes2
answers358
viewsA: how to get class name with javascript
Take the class name if it is an input or select: var elementos = document.getElementsByClassName("nome da classe").value; Take the contents of an element if it is not input or select: var elementos…
-
0
votes1
answer98
viewsQ: Does anyone know if it is possible to style the native Chrome Notification (API)?
Hello, I’ve been asked to use Chrome’s native Notification (API) to display a notification to the user as soon as they enter the system (I know I could use other modes, but I’ve been asked to use…
-
2
votes1
answer255
viewsQ: How to define an image, coming from the database and stored in binary, as background-image of a div?
I have an image that is stored in the database of binary form. I rescued this image (through a select) and would like to insert it as a background-image of a div. I can only insert it as src of a…
-
3
votes2
answers304
viewsQ: How to get components beyond the standards in Fullcalendar?
I would like to know how to get other components (besides id, title, start and end) in Fullcalenda. I have a table, in the database, which has several fields such as status, responsibility,…
-
0
votes1
answer78
viewsA: Data returned from PHP does not appear in the Fullcallendar calendar
I managed to solve: The error is in the section below: <?php $query = "SELECT CONCAT(tipo_atividade , ' (', COUNT(tipo_atividade) , ')') AS title , DATE_FORMAT(dt_vencimento , '%d-%m-%Y…
-
0
votes1
answer78
viewsQ: Data returned from PHP does not appear in the Fullcallendar calendar
I am trying to list in a calendar (in the form of events), implemented with Fullcallendar, data resulting from a database query. The calendar appears, only the events that should be listed on it,…
-
0
votes0
answers200
viewsQ: How to verify if any record has been returned, the amount of it and if any record has been changed in a query with PDO and Mysql?
After performing a query (An INSERT or UPDATE) I would like to know if any changes were made in the database or if nothing happened. With Mysqli I used mysqli_affected_rows. However, I don’t know…
-
1
votes2
answers86
viewsQ: Same character set generating different hashs after conversion with MD5()
Hello, I am creating a system that has a user registration area on the system. In the password part I use md5() to transform the characters into Hash. Only I’m noticing the following, sometimes I…
phpasked Gato de Schrödinger 2,367 -
0
votes1
answer56
viewsQ: What are the differences when including values (coming from a form for example), in a query mounted in PHP and executed in MYSQL, among the forms below?
I have studied and seen that there are different ways of treating data before inserting them into a query which is executed in the database. I have some questions about security and the issue of…
-
10
votes2
answers216
viewsQ: What are the correct tools to debug Javascript code for viewing in the Browser?
Recently, looking at a question here from Stackoverflow, I noticed a user comment that said console log. and the Alert were not correct ways to debug Javascript codes. This question left me…
-
2
votes2
answers193
viewsQ: How to make a Select with multiple SUM?
Hello, I have a table of activities that lists activity data, including her status. I would like to sum up the activities of a particular user and display in a graph, showing according to the status…
mysqlasked Gato de Schrödinger 2,367 -
3
votes2
answers56
viewsA: mysqly connection to php
I saw a part of your code that I believe is the reason you are not entering the data. Your 'INSERT' is without the table name. It’s like this: <?php "INSERT INTO('nome', 'cnpj') VALUES…
-
0
votes2
answers749
viewsQ: Does anyone know the possible cause of the "Uncaught Error: Syntax error, unrecognized Expression" error?
I have a code in jQuery that I hold an event when I click a certain button. The problem is that when this event runs, the console shows me the following error: That a. stand-by-column is an 'a'…
-
2
votes1
answer683
viewsQ: Date sorting problems in Datatables
Hello. I know there are several topics here on Stack, but I’ve tried all the options suggested in the answers and failed. My problem is that when I click on the table header to sort it by date…
-
2
votes0
answers107
viewsQ: How to find an image that is stored in the database and display it in an HTML IMG?
So, I am making a page on which the user uploads an image and it is stored in the database (Mysql). See below how it is stored in the bank: So far so good. Now I would like to take this image and…
-
1
votes1
answer58
viewsQ: Error in forming a string through a Loop (with Foreach) in an Array
Hello. I have a code that makes a Foreach in an Array that forms a String (in a variable) with all the values of this Array. The problem is that when I echo this String, at the end of the Loop, no…
-
2
votes2
answers81
viewsA: Problems in the use of PDO
After following Anderson’s lead, I did the code the right way. It goes down like it was: function pesquisarDetalhesClientes(dados, cod_line, depart_line) { $.ajax({ type: "POST", data: { botao:…
-
2
votes2
answers81
viewsQ: Problems in the use of PDO
I used to use Mysqli, but now I started using PDO. I’m having a little trouble at the beginning. I made the code below, only when I use the parole and it enters the else, something is not returned…
-
2
votes1
answer94
viewsQ: Difficulty in the methodology of programming and migration from mysqli to PDO
Hello, everybody. I always programmed in the Back-End part (with PHP) using mysqli, but after reading some articles and comments, I came to the conclusion that I need to change my method of…
-
1
votes1
answer500
viewsQ: How to add ID to the tr that are generated with Datatables?
Hello! The Datatables plugin serves to make a table (HTML) after receiving a JSON with the data resulting from a query to the database. Until then beauty, the problem is that as the table structure…
-
1
votes2
answers444
viewsQ: Print all pages of pagination in Datatables
Hello, I have a system in which, on one of your pages, I display the data that comes from a database table. Since to make this view I use the Datatables plugin. The problem is that when I try to…
-
5
votes1
answer129
viewsQ: How to find a specific id within a list?
I’ll try to summarize. I have a list in which I have elements with various ids. I would like to select a specific element within that list. Only that the ID value that will be searched for will be…
-
5
votes1
answer310
viewsQ: How to implement a pagination using PHP and Ajax
I make a query in the database through PHP that receives the data from an AJAX. (And then returns the query data to AJAX) So far so good. The problem is that I would like to paginate these data…
-
0
votes1
answer330
viewsA: Problem with accentuation in the return of PHP to Data Tables
Solved. I couldn’t understand why, but using utf8_encode() embracing utf8_decode(), which embraces the data coming from the database, worked. If anyone knows why it worked, just comment here. Look…
-
0
votes1
answer330
viewsQ: Problem with accentuation in the return of PHP to Data Tables
Hello. I am performing a query to the database, with php and mysql, and return the result of this query to Datatables (in the form of JSON) which lists this result in a table in my HTML. The problem…
-
-3
votes1
answer221
viewsQ: How to send multiple files via AJAX and store them in the database?
I have a form in which I can send a single file, by a file field, and store it in the database. However, I need to be able to send more than one file through the form and store them in the database.…
-
6
votes2
answers73
viewsQ: What makes a code have different visual representations in different browsers?
I have a website that I am developing on which I have a top set menu (a navbar). The problem is this navbar has different views on Chrome and Firefox. I’d like to know why this is happening. I use…
-
2
votes1
answer299
viewsQ: Insert being executed twice
I have a code for when a logout in the system, to be registered in a table of the database. I call this file that logs out when I click the quit button and also when I close the window in the…
-
1
votes1
answer64
viewsA: How do I log the user’s logout when he closes the browser or a tab of it?
Dude, I got a solution (with a friend) that can be useful for many people who want to do something similar. I used the window.onbeforeunload = Function(){} that performs the function when we close…
-
0
votes1
answer64
viewsQ: How do I log the user’s logout when he closes the browser or a tab of it?
I am creating a web application and need to log user login and logout in a database table. I did everything right, is logging in (when user logs in) and logout (when user closes system on button).…
-
4
votes1
answer681
viewsQ: Get the current date and time here from Brazil to enter in the database
I have a table that records the login and logout of users on the system. However, when the login is done, the date and time stored are not being added according to the time zone of Brasilia. Follow…
-
0
votes1
answer68
viewsA: Function is only called on the first click of the button
Solved. I traded: $(document).on("click", ".botao-chat", function(e) { console.log("Clicou no botão"); var chamar = zerarMensagem(); }); For: $(".botao-chat").click(function(e) { console.log("Clicou…
-
0
votes1
answer68
viewsQ: Function is only called on the first click of the button
I have a code in which I show the count of new messages that the user has in a chat (This count is in the database). This chat room is like a chat room. So I made an event that when the user clicks…
-
0
votes0
answers29
viewsQ: Problems with Cookies and Cache in programming
I am with a doubt that may seem very amateur and without context to clarify in stackoverflow. I don’t know if I’ll find an answer here either. But I have a problem (I don’t know if it’s just…
-
0
votes2
answers616
viewsQ: How to make a SELECT DISTINCT with COUNT in Mysql?
So, I need to make a SELECT that searches the bank for information about all the activities of the companies and returns the sum of all the "QNTD_PROCESSOS" of that activity. I’m trying to make a…
-
1
votes2
answers1159
viewsQ: How to use the Pattern attribute with regular expression correctly?
I’d like to use one pattern in my input (has to be the text) with the following rules: Input only accepts up to 4 characters. These characters can only be numbers from 0 to 9. User CANNOT start…