Posts by Diego Marques • 3,701 points
159 posts
-
0
votes1
answer82
viewsA: Add fields with Jquery
The problem with your code is that the HTML structure was invalid. I noticed you put the tag <form>, then tagged <p> for each row of fields, but you were closing the tag <p>…
-
2
votes1
answer49
viewsA: What is the best way to save multiple image links in a database?
The ideal in this case, according to data normalization, is to separate this information in another table in a 1xN relationship. For example, create the table veiculo_imagens with the fields…
-
1
votes1
answer43
viewsA: Button with writing on top of the other
In this case the problem is that you put the line-height as 50px, then when you created a line break, the two lines would be 50px size, resulting in an element with 100px tall (50px for each line).…
-
1
votes1
answer360
viewsA: Export Table to Excel, Problems with String Numeric
To escape a number in a cell as a string, you can put a simple quotation mark at the beginning of the cell, so it would look like this: ... <table> <tr> <td>'89551010326000103872…
-
2
votes3
answers69
viewsA: How can I check equal variables within a while
In this case you can already bring this information from the database, doing a check for each line. Follow an example based on your code: Query: SELECT os, nome, data, ( CASE WHEN EXISTS( SELECT os…
-
1
votes1
answer66
viewsA: How to put two records from one table into another as one in select Mysql Database
In this case just use one GROUP BY with the function GROUP_CONCAT, ex: SELECT MIN(TURMA.turma_id) AS turma_id, TURMA.turma_nome, GROUP_CONCAT(PROF.prof_name SEPARATOR ', ') AS prof_name FROM turma…
-
2
votes2
answers905
viewsA: Insert ID from one Table into another Table
Just create a column in the other table with exactly the same data type, e.g., if you have the column in the first table being INT(11) UNSIGNED, in the other table you need to be exactly INT(11)…
-
1
votes1
answer57
viewsA: I am creating a school system, I want together a list of linked teachers and materials Database (Mysql)
What you need is an n x n relationship, that is, many for many. This type of relationship between two tables requires a third table that will contain the foreign keys of the two tables in question.…
-
4
votes1
answer2098
viewsA: need to make the form fill the info from the search by cnpj
In this case it is necessary to include an event of click on the button, and then perform the Ajax call to fill the form with the return. Below is an example: $(document).ready(function(){ //…
-
0
votes1
answer83
viewsA: Menu Responsive
Using Javascript To make it appear with click, you can with javascript, below is an example: function showMenu() { var $navbar = document.getElementById('navbar'); var style =…
-
5
votes2
answers51
viewsA: How to make html transferable between computers without losing hyperlink and images?
To avoid or minimize this type of problem you can use relative paths. To reference from the "folder" to which the file was opened, start the bar-free path, example: You have the following structure:…
htmlanswered Diego Marques 3,701 -
3
votes2
answers853
viewsA: COUNT in several tables
You can do it like this: SELECT (SELECT COUNT(publications.id) FROM publications) AS total1, (SELECT COUNT(deejays.id) FROM deejays) AS total2)
-
1
votes1
answer74
viewsA: Are you a class superscript?
The selector + is to select the next "brother" element. In this case, the way you mounted the interpreter read: .divCheckBox .checkBox:checked + .divCheckBox .labelCheckBox Select all elements with…
-
0
votes1
answer575
viewsA: Change icone and display None/block
I’ve identified some issues in your code: The classList.contains checks only one class at a time, and you were passing two (fa and fa-angle-down or fa-angle-up). The toggle logic wasn’t correct.…
-
1
votes1
answer670
viewsA: Bootstrap button at the same height and position in mobile versions
In this case the problem is that you have included the classes in the button col-sm-6 col-xs-12, and they are used to define bootstrap grid system columns. There is no standard bootstrap class to…
-
2
votes1
answer585
viewsA: Error returning Stringstr
In this case it is a syntax error, its variable name is missing the dollar $, which is mandatory for variables as per PHP language definition. Therefore including the cipher should work: function…
-
0
votes1
answer42
viewsA: Size Scale to Convert psd> css Ionic ## Size scale to convert psd > css Ionic
I suggest the breakpoints of the bootstrap itself: <= 768px: Smarthphones <= 992px: Small desktop and tablets <= 1200px: Large Desktop > 1200px: Very large desktops (e.g. full hd:…
-
1
votes1
answer695
viewsA: MYSQL query bring results in order of distance using coordinates
You can calculate the distance using an arithmetic expression, example: SELECT l.id, l.lat, l.lng, ( 3959 * acos( cos( radians(c.lat) ) * cos( radians( l.lat ) ) * cos( radians( l.lng ) -…
mysqlanswered Diego Marques 3,701 -
1
votes1
answer44
viewsA: Problem rotating an object continuously
Analyzing your code identified that this function that converts to matrix for angle has limitations after given angle, so I suggest a simpler approach saving the angle elsewhere, as example below:…
-
1
votes2
answers288
viewsA: Changing button function via jQuery
In this case you need to move to the function which was the button clicked, then delete it from the list of buttons to be disabled. Below is an example of logic: function addCartao(product_id,…
-
3
votes2
answers255
viewsA: What would be the 'e' passed as a parameter in js functions?
In this case this 'e' is a specific parameter in specific functions, such as events. It is very common in jQuery. For example, when we create an onclick at a link: $('#link-legal').on('click',…
-
0
votes3
answers1717
viewsA: Picking up the label text only if there is a label
This is because when printing the log with the line console.log($(this).find("label").text()); it executes in the following sequence: $(this) -> Takes the current element o each .find("label")…
-
5
votes3
answers1301
viewsA: Why are you concatenating instead of adding?
What happens is that the function prompt always returns a string, so for the final account to be a sum and no concatenation it is necessary to convert the return of the function prompt for float:…
javascriptanswered Diego Marques 3,701 -
3
votes2
answers1341
viewsA: HTML Show enlarged image by clicking
This you can do with jQuery by placing an event that, when clicking on the image, is created a copy of the image in the desired area, below follows an approach of how to do:…
-
1
votes2
answers855
viewsA: Update Inner Join (update in two tables) - Php; Mysql
The JOIN with UPDATE has the function of only contributing to the filter of the records that will be updated. Therefore it is not possible to update two tables with the same UPDATE. In this case you…
-
3
votes2
answers654
viewsA: How to replace one substring within a string with another?
In this case, the function you need is the str_replace, which replaces all occurrences of one string with another in a string. Example: <?php echo str_replace("mundo", "Júlio", "Olá mundo!");…
phpanswered Diego Marques 3,701 -
2
votes2
answers82
viewsA: Arrays array loops do not work
Your logic is correct, follow an example with the command push which serves precisely to include a record at the end of a array: /* Inicializa a variável */ // A estrutura final ficará…
-
0
votes2
answers287
viewsA: Decrease a Mysql value
Automatically it does not have, but there are some approaches to do this. The simplest is to implement in the query itself that makes the update, follow an example: UPDATE tabela SET campo1 =…
mysqlanswered Diego Marques 3,701 -
2
votes2
answers424
viewsA: move_uploaded_file only works once in the file
What happens in this case is the following: When the POST is done by sending the file through the form, this file is saved in the server memory, and when you use the function move_uploaded_file It…
phpanswered Diego Marques 3,701 -
1
votes0
answers201
viewsQ: What is the difference between SELECT * AND SELECT field1,...?
If I need all fields in the table, there is a difference in performance between using the joker "*" (SELECT * FROM ...) and specify all fields in the table (SELECT campo1, campo2... FROM ...)?…
-
3
votes2
answers1579
viewsA: How to import database data into form field
To set an initial value to form fields, you follow these patterns: For input text, email, password, etc. Sets the value by the attribute value. Example: <input type="text" name="nome" value="João…
-
0
votes3
answers62
viewsA: Get only 1 of each journey
What you need is to group the records. Then you can use the clause GROUP BY. Here is an example based on your schema: SELECT jornada FROM tabelajornadas GROUP BY jornada ORDER BY jornada; The GROUP…
-
1
votes3
answers2910
viewsA: Routes accessible only to users logged in to Laravel?
For this you can use the Middleware Laravel, which are basically functions executed before or after the route that can affect the execution of a controller / action. An example from Middleware:…
-
4
votes3
answers590
viewsA: Never use inline styles is never really?
This use of leaving the canvas tag with width and height empty is probably to clear the default values that every tag has. In the case of CSS, this technique is also used and has the common name of…
-
1
votes2
answers97
viewsA: 100% modal with CSS
The blocking "modal" is possible to do only with CSS, but to close with the click, you need Javascript to modify the behavior of DOM: #carregando { background: rgba(0, 0, 0, 0.8); color: #fff;…
-
5
votes3
answers6672
viewsA: Validate file extension
It is possible, because the attribute value input returns the file name: $j(function () { $j("#arquivo").change(function () {//ou Id do input var fileInput = $j(this); var maxSize =…
-
0
votes2
answers27
viewsA: how to call a javascript function on all buttons with a class
In this case just change the dial, follows below: <div class="buttons"> <div class="classchama"> <input type="submit" class="button" value="Cadastrar produto" id="inviardesb">…
-
0
votes1
answer35
viewsA: Is it a redundancy to have a single button in the form and then assign type='Ubmit' to it?
Yes, the default attribute value type tag button is the submit as referenced W3C official. So in theory you can omit it smoothly. But maintaining will also not generate problems.…
-
6
votes2
answers254
viewsA: Group By different results
In the second query you are using the HAVING to filter. But the HAVING is to perform filters after the GROUP BY. Therefore in this case he is assuming that it is to do the grouping without any…
-
1
votes2
answers490
viewsA: Change Videos from Canvas
In this case, just make a function that changes the attribute src iframe, example: function changeVideo($a) { document.getElementById('video-curso1').src = $a.href; return false; } <a…
javascriptanswered Diego Marques 3,701 -
1
votes4
answers97
viewsA: Create a SELECT to bring the difference of two tables
For this query, you need to select all table records bisemanas, make a LEFT JOIN with the table outdoor_bisemanas and filter only by records where the table primary key outdoor_bisemanas returned…
-
-1
votes4
answers183
viewsA: Pdostatement::rowCount returns -1
For PDO You can use the method rowCount which returns the number of rows affected by the last DELETE, INSERT or UPDATE running by the last object PDOStatement. Definition: public int…
-
1
votes2
answers42
viewsA: Doubt in <option> of <select>
In this case you need to check the value of the variable for each option, and if it is the option select, print the attribute selected in option. Example: <div class="form-group"> <label…
-
3
votes1
answer305
viewsA: effect with css Transition in Angular
What happens is that the property transition animates from a previous state to the current state. When you add the class, the middle element that does not have a previous state, it may be hidden…
-
0
votes1
answer53
viewsA: foreign key
This is because if you pass a value as an empty string in a field that is INT, Mysql puts 0. For this, you just have to work the variable $id_pessoa to carry the value of NULL for Mysql when empty.…
phpanswered Diego Marques 3,701 -
4
votes1
answer93
viewsA: Does anyone have any idea how google drive unzips file in real time
You can use some library that reads ZIPS files. PHP itself has these functions as: Zip Open Zip Read…
-
0
votes3
answers1702
viewsA: Create button with border and gradient text
This comes very close to what you need: .botao { display: inline-block; padding: 12px 18px; border-radius: 10px; text-decoration: none; font-family: Sans-serif; font-weight: bold; overflow: hidden;…
-
6
votes3
answers269
viewsA: Click a buttom and a prompt appears
You can do with a same link tag (<a></a>) and the function confirm of Javascript. Example: <a href="https://www.google.com/" target="_blank" onclick="return confirm('Deseja realmente…
javascriptanswered Diego Marques 3,701 -
0
votes2
answers352
viewsA: Insert text in time line
For this solution, simply build a "tab" structure. Follow an example with jQuery: $('.DB_Timeline__item').on('click', function() { $('#tabs > div:visible').hide(); $('#tab-' +…
-
2
votes1
answer1847
viewsA: Display Popup when you realize the user will leave the page
In this case, what you want is the event of when the user takes the mouse out of the window. For this you can use a solution like this: Create a function that applies cross-browser mode event:…