Posts by Alexandre Paiva • 367 points
14 posts
-
0
votes1
answer505
viewsA: .map() is not a Function
The function .map() does not work with objects, only with arrays. When it is an object, the way to use the .map() would be so: Object.keys(data).map(item => {...}); Where data is the variable…
-
0
votes1
answer158
viewsA: I click the save button to register a product in my database and nothing happens HTML + PHP
You have created multiple tags <form> (one inside the other) in your code. Keep only one, this one: <form class="form-horizontal" method="post" action="gravaproduto.php"> Ps: try to…
-
0
votes2
answers700
viewsA: Line break in CSV file causes error during import
Try using a regular expression to remove line breaks in the variable linha. For example, below the var linha, add this code here: linha = Regex.Replace(input, @"\r\n?|\n", linha); That way, before…
-
0
votes1
answer29
viewsA: How to read this scope?
if($resultado_usuario){ $_SESSION['id'] = mysqli_insert_id($conn); header("Location: form2.php"); } If the record was saved in the bank successfully (if($resultado_usuario)) then takes the ID…
phpanswered Alexandre Paiva 367 -
3
votes2
answers207
viewsA: How to check whether an image has been clicked or not
In javascript, it creates a variable where you will store the current lamp state. This way you can then better control whether the lamp is lit or not. For example: let lampada = false; function…
-
-1
votes2
answers55
viewsA: exbir text according to the output of the variable field
I haven’t worked with WP and its plugins for a long time. But using logic in your case, I would use a if to check if the field exists, then update the value of the the_field adding the word you…
-
4
votes3
answers216
viewsA: As a search for any term removing spaces, traces and points with LIKE
I think the best way to do this is to remove the spaces and points in the backend before submitting the term to the SQL query. And in the query, you do the same with the field, removing the spaces…
-
2
votes1
answer28
viewsA: working with dates
Hello, You could build your query as in this example: SELECT DATE_ADD(last_day(dataAtendimento), INTERVAL 10 DAY) as dataPagamento FROM `nome_da_sua_tabela` Ps: change the above code table to your…
mysqlanswered Alexandre Paiva 367 -
1
votes2
answers150
viewsA: Mysql problems connecting to a python database
Hello, You are not defining which database (db) will use for connection. Set like this: db = MySQLdb.connect( host="localhost", user="k4os", passwd="#mypass#", db="SEU_BD" ) If even then the error…
-
1
votes2
answers146
viewsA: Return all checkboxes unchecked via jquery
Hello, I’d do it this way: $('#enviar').on('click', function(e){ e.preventDefault(); // cria o array com os id's dos checkbox selecionados var array_id =…
-
2
votes2
answers2394
viewsA: How do I get the Logged in user ID in the PHP session and play in a variable to insert?
if ($row > 0) { $dados_usuario = mysqli_fetch_assoc($result); $_SESSION['id_usuario'] = $dados_usuario['id']; $_SESSION['usuario'] = $usuario; $_SESSION['senha'] = $senha; header('Location:…
-
1
votes1
answer30
viewsA: Place date command inside e-mail
Hello, You can send the time message as follows: mail -s "DEPLOY" [email protected] <<< "Informamos que o sistema tera um deploy as $(date +'%H:%M')"…
-
1
votes1
answer135
viewsA: What is the difference between "merge" and "Fill" in Adonisjs' Lucid?
No Lucid when you use the method fill, all other existing values will be removed keeping only what you have just set. You can use this method when you want to insert a record with fully defined…
-
2
votes1
answer182
viewsA: Fetch a specific value of an array according to values of another array and show the value of another field
Hello, the following code should solve your problem. foreach ($entrada as $key => $value) { if(false !== $key_search = array_search($value['tamanho'], array_column($estoque, 'tamanho'))) {…
phpanswered Alexandre Paiva 367