Posts by Gabriel Carvalho • 582 points
23 posts
-
3
votes3
answers1365
viewsA: Creating html elements in javascript looping
Every click on the "ADD" button you want to add a new input, right? Pq you remove all fields before adding +1? while (container.hasChildNodes()) { container.removeChild(container.lastChild); } To…
-
2
votes1
answer79
viewsA: Is it correct to store a record to use during the process lifecycle in a session variable?
I believe that the most practical and least costly way would be for you to create a single key column in your database table, even varchar, to store a second identifier. This second identifier must…
-
1
votes1
answer240
viewsA: Why doesn’t the ajax work?
Ajax acts as an intermediary/communicator between your HTML and PHP. Through it you can update data from your page without necessarily updating it, can send data to your server by background, can…
-
3
votes1
answer53
viewsA: My session is not being destroyed -PHP-
We have a logic error there. See that you first check if the session exists and then start it. Since you didn’t start it, it will never enter the IF to be destroyed. Put session_start() outside the…
-
2
votes3
answers161
viewsA: How to perform a select by multiple fk?
Use the list of tables SELECT ingredientes.*, receitas.* FROM ingredientes INNER JOIN ingredientes_receitas ON (ingredientes.cod_ingrediente = ingredientes_receitas.cod_ingrediente) INNER JOIN…
-
1
votes2
answers266
viewsA: Button to select which carousel to display
You can include on the button a generic class to identify the click and an attribute "date" identifying which carousel should be shown, example: <button class="ative btn btn-outline-info…
-
0
votes1
answer36
viewsA: Session not being updated
For use of sessions, you must call the function session_start() before calling the global variable $_SESSION. Another point is that there is no need to call this function twice on the same php page.…
-
0
votes1
answer95
viewsA: Parameter $_FILES undefined
@aleque_b, sending FILE by ajax does not work equal sending a common form. Before the body closes and after the jquery include, include the script: <script…
phpanswered Gabriel Carvalho 582 -
1
votes1
answer144
viewsA: Loop php in an HTML class
Gustavo, you can do: $a = ""; foreach ($arr as $key => $value) $a .= "<div><div class='x_".$key."'></div></div>"; echo $a; or tbm put a counter: $count = 0; $a = "";…
-
0
votes2
answers80
viewsA: Date sorting problem with DATATABLE plugin
Thiago, the ordering in the datatable is by default (year-month-day). In the column containing the date, you can do: <tr> <td data-order="DATAPADRAO">DATA_BR</td> </tr> More…
-
1
votes1
answer65
viewsQ: mysql random questions
I have a somewhat complex question and I need help: I have a database with the following links: Exemplifying: I am in the history class about Karl Marx. This class is linked to a certain group of…
-
1
votes4
answers751
viewsA: How to create a <a> link without refreshing
Try: <a href="#!" class="nada"><img src="imagens/icone-construcao.png"></a>
-
0
votes1
answer95
viewsA: Jade/Pug not repeat the same code
Use the mixin feature. mixin loop-lista(photourl,nome,svg-bg-url,totalbg,svg-gamepad-url,totalgp,svg-ql,totalql) li.educator-photo figure img(src=photourl, alt=nome) figcaption =nome li.hr hr…
-
1
votes1
answer139
viewsA: Table with PUG in Nodejs
do as with other parameters table.table thead tr th Exemplo th Exemplo2 tbody tr td td tr td .... If you want to do it with dynamic data, use each. table.table(class=type) thead tr each head, i in…
-
2
votes2
answers9442
viewsA: How to catch the JSON return via jQuery?
It has several forms, follows two examples: $.ajax({ url: 'sua-url', type: 'POST', dataType: 'json', data: {seus-dados}, success: function(data) { var acctid = data.acctid var status = data.status…
-
1
votes2
answers137
viewsA: How do you get another div with the same name without changing the others?
speech Felipe, you are giving the order to change all Divs with the "precoproduct" class. To solve your problem, you can do the following: $(document).on("click",".tam-selecionado",function(e) {…
-
0
votes3
answers14251
viewsA: Select elements containing a particular "date" attribute
Most current model: var target = $("#suaDIV").data("my-target");
-
1
votes1
answer65
viewsA: Problems in Pseudo Class Nth-Child(n) CSS3
Your problem is not the modal div, since in CSS you set the .row. CSS is doing exactly what you say, coloring an entire column of gray and another entire column of white. To resolve otherwise, do…
-
0
votes2
answers368
viewsA: Customers who bought in one year but not another
Could you explain your structure better? Is there a foreign key? The ideal would be to have a table only with customer registration and another table with purchases, so you could do with LEFT JOIN,…
-
1
votes2
answers3966
viewsA: I need to put a button next to an input of type select, how to do?
Use the resources of the bootstrap itself. Add an "Row" class before calling the form-group and activate the col-Md classes-*' <form> .... <div class="row"> <fieldset…
-
0
votes2
answers100
viewsA: How to get button value when firing a Shown.bs.modal event
IN HTML: We use the resource date-* : <button id="meubotao"type="button" data-value="5">Click Me!</button> IN THE SCRIPT: We need to redeem the value. //Evento de disparo para quando…
-
0
votes2
answers87
viewsA: Query INNER JOIN apply bind parameter
$stmt = $conn->prepare("SELECT quantity.order_id, quantity.ISBN, quantity.quantity,orders.customer_id, orders.created, orders.status FROM orders INNER JOIN quantity ON…
-
1
votes2
answers1164
viewsA: How to know when an item is at the top of the page
$(window).scroll(function() { //Altura atual do scroll var tamScroll = $(this).scrollTop(); //Altura para disparar ação if(tamScroll >= 50) { //Loop para section $('.screen').each(function(i) {…