Posts by Luis Alberto Batista • 1,002 points
69 posts
-
0
votes2
answers480
viewsA: how to make a mysql query that contains multiple id separated by comma
If you pass the query string with double quotes as there below you can play directly the variable as there below. Then just use the IN clause, but have to ensure that the data comes separated by…
-
0
votes1
answer62
viewsA: Hiding another component element in Angular
I made several changes and this time I tested before, and here it seems to me to have worked now. header-dashboad-Component.ts import { Component, OnInit, ViewChild } from '@angular/core'; import {…
-
0
votes1
answer56
viewsA: Html form is not calling php
Try to do it that way: <form action="index.php" method="POST"> <div> <label>Login:</label> <input type="text" name="user"><br> </div> <div>…
-
0
votes1
answer230
viewsA: how to create and write txt file with fopen in a network folder
Simple example of an execution of this task. <?php // Caminho do arquivo na rede $filename = "//10.96.1.100/Pasta/Na/Rede/Arquivo.txt"; // Modo de leitura e escrita $mode = "w+"; // Inicializar o…
phpanswered Luis Alberto Batista 1,002 -
1
votes1
answer89
viewsA: Run SQL Query multiple times between two dates (MYSQL)
Got two outs to make: Between dates with BETWEEN select * from teste where data between '20/04/2020' and '24/04/2020' This will return the day (20, 21, 22, 23 and 24) if they exist Either date…
-
-1
votes3
answers43
viewsA: How to Cast Another Class in PHP
There is no way to do this explicitly stating the types, because PHP uses dynamic typing. But there’s a little bar forcing in the language that helps you show PHP what you want. For example class…
-
4
votes3
answers81
viewsA: Why does this account return a negative number?
In the algorithm, he’s understanding that Voce is doing the expression "+ 1 - 3 * 2" First thing that is done is multiplication, on account of the natural order of operations "- 3 * 2" resulting in…
javascriptanswered Luis Alberto Batista 1,002 -
2
votes3
answers170
viewsA: How to change property access level in an inheritance?
In the Parent class, Attribute in this case must be Protected (Protected). This causes the Son to access, but from outside the class this is not possible, only for internal use. public class Pai {…
-
2
votes1
answer361
viewsA: React Native with PHP
YES AND NO. YES, because it’s more convenient, since the form of connectivity will be much easier, with you registering a domain, buying a hosting, and directing the APP calls to this structure. NO,…
-
0
votes3
answers1050
viewsA: Use jQuery in a JS file
Both jQuery and any other JS file should be imported into the gave head of each HTML that uses them. <html> <head> <script…
-
2
votes1
answer246
viewsA: Subtract PHP date and time
Can resilver this with the objects of Datetime and Dateinterval. Following example: <?php // Intervalo de 5 horas. $Intervalo = new DateInterval("PT5H"); // P = Periodo que no seu caso não se…
-
3
votes2
answers78
viewsA: Condition does not enter as entered
When you simply test F without comparing to Letter without pre will be true. if Letra == "F" or "f": # Isto está teoricamente errado. When you simply test M without comparing with Letter without pre…
-
0
votes1
answer34
viewsA: $_SERVER['HTTP_HOST'] generating 2 times
I do it this way: I create a file called Constants.php: In this file I save all the paths of my application as in the example: // Diretório absoluto do servidor / htdocs ou www/html.…
-
2
votes2
answers117
viewsA: Sort mysql query by numbers present in varchar column
I created the table, entered the data and everything went well here. Follows code: SELECT id, nome, preco, catalogo FROM moedas ORDER BY catalogo ASC Output from my mysql: 2 | moeda 2 | 45,66 | CJ…
mysqlanswered Luis Alberto Batista 1,002 -
0
votes1
answer97
viewsA: TRIGGER does not work in MYSQL
You need to ensure that when you run Rigger, reference data is available. so much for: REFERENCES tbCliente (codigo_cliente) Where the client code needs to be guaranteed to be registered. How much…
-
1
votes1
answer47
viewsA: Doubt about UML
From what I understand, it is not really within the best standards, but it seems that Window is a subclass of Glyph, and makes use of the Draw method providing an instance of Window by running the…
umlanswered Luis Alberto Batista 1,002 -
1
votes1
answer248
viewsA: PHP error : move_uploaded_file
Next to line 36 I did the following: I made a merge of the system root folder, your project folder and uploads folder. //PASTA // Juntando pasta root do sistema, pasta do projeto e caminho do…
phpanswered Luis Alberto Batista 1,002 -
1
votes2
answers616
viewsA: How to make a SELECT DISTINCT with COUNT in Mysql?
If you Use COUNT and DISTINCT will generate the value of 1 for each line. Do something like this:underlined text SELECT DEPARTAMENTO, RESPONSAVEL, COD, EMPRESAS, TRIBUTACAO, TIPO_ATIVIDADE,…
-
-1
votes3
answers500
viewsA: Android - Remove White Space Between Recyclerview Items
Adjust your Recycler to grab available screen space. <android.support.v7.widget.RecyclerView android:id="@+id/recyclerOverlay" android:layout_width="match_parent"…
-
0
votes3
answers240
viewsA: View does not appear in query - Sql Server
Are you sure View already exists? To delete the existing do: DROP VIEW IF EXISTS Nome_da_View; To recreate do: CREATE VIEW Nome_da_View AS SELECT B.TX_LOGIN, COUNT(A.CD_PROCESSO) AS TOTAL FROM…
-
1
votes1
answer40
viewsA: Doubt in self-relational table modeling
Bringing to a deferential abstraction, which in my head would be more organized. Letter should keep the letter data. cards(id, name, img_front, img_coast) Duel would mention the relationship you…
-
1
votes1
answer42
viewsA: Save multiple data with a single identifier in mysql and php
Loajas modeling (already existing) store(id, name, [...]) Product modeling (already existing) product(id, code, description, [...]) Discount Modeling (Which I would do) store(id, loja_id, product,…
-
1
votes2
answers59
viewsA: Table Receives 2 foreign keys - Relational Model
Creating a sort of generic perspective of modeling I would imagine something like this: Guard all the staff People(ID, Name); Ranks employees Employees(Personal ID, License plate, [...]); Ranks…
-
-1
votes2
answers863
viewsA: How to insert into 3 tables at once? (PHP +Mysql)
I have a very long answer. But maybe it’ll do for a north. My idea is that you separate the layers of the program. I tried to express quite generic below: <?php // Contexto do modelo da livraria.…
-
1
votes1
answer81
viewsQ: VBA Add "-" every two characters to form MAC Address
I would like to form a MAC address from the data collected from a barcode reader. I need every two characters to be added one "-". Entry text: A9B8C7D6E5F4 Output text: A9-B8-C7-D6-E5-F4 So far I…
-
2
votes3
answers1358
viewsA: Problems adding Foreign key to Mysql
In the car would add the plate as data uniqueness. create table automoveis ( placa char(7), codigo int, ano int, fabricante varchar(20), modelo varchar(20), pais varchar(20), precoTabela decimal(8,…
-
-1
votes2
answers93
viewsA: How to validate return of a method like php7 object array?
Maybe ::class can help you, because in the tests here he confirmed the type of class. I test as follows (Most important is at the end): <?php namespace classes\util; class Util { public function…
php-7answered Luis Alberto Batista 1,002 -
0
votes2
answers236
viewsA: PHP+Mysql Search System
Rodrigo, test this shape and tell me if it fits. In my imagination it seems to work SURROUNDING ONLY THE $_GET DEFINED. <?php $get = []; if(isset($_GET['nfe']) && !empty($_GET['nfe'])) {…
-
0
votes2
answers80
viewsA: Input datetime has no calendar option
To do this I usually use jQuery-UI. Below is a generic use example. $("#DataInicio").on("click", function() { $("#DataInicio").datepicker({ dateFormat: 'dd-mm-yy' }); });…
htmlanswered Luis Alberto Batista 1,002 -
0
votes2
answers1389
viewsA: How to put the image address in src without it having to be a Component in React
Here is a very generic example, but it shows that yes, it is possible without. function carregarImagem() { var imagem = document.getElementById("imagem"); imagem.src =…
-
1
votes2
answers65
viewsA: Why value looks different with printf and echo
As I noticed, when you use %d you are asking the printf to show the absolute integer, then when you put everything together in the "%d:%d", there is 0.25 minutes left of the hour, this leftover is…
phpanswered Luis Alberto Batista 1,002 -
1
votes2
answers61
viewsA: What is it missing?
The form needs to "embrace" the components that should be sent to the server. <form name="f_cad" method="POST"> <input type="text" name="Nome" /> </form> To test do so. <?php…
-
5
votes1
answer2437
viewsA: How to catch the first and last day of the current month ? PHP
It has a form that will be presented here in a very generic way, but useful, which follows below: <?php // Definir a zona geográfica padrão. date_default_timezone_set("America/Sao_Paulo"); //…
-
3
votes2
answers707
viewsA: Why use Legacy Interface instead?
It depends a lot on what you abstract. In cases where standardizing method signatures can be used, the interface can be used, already in cases where if we reuse the attributes of a class and also…
-
2
votes1
answer66
viewsA: Java type incompatibility
When you do an Insert, the return is not a Resultset, but an integer containing the amount of lines affected by the executed transaction. To recover something via Resultset using executeUpdate would…
-
0
votes4
answers737
viewsA: How do I close the form I’m in?
Close with: form1.Dispose(); This will shut down the instance for good.
-
1
votes1
answer43
viewsA: Calculate via JS by Span id
For starters, make sure that jQuery is imported into your page... Cup the next: $("#aaa").on("change", function() { Recalcular(); }); $("#bbb").on("change", function() { Recalcular(); });…
javascriptanswered Luis Alberto Batista 1,002 -
0
votes1
answer206
viewsA: Information an HTML inside a JSON request in PHP
In the context of PHP do: $Dados = "<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\"> <head> <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />…
-
1
votes2
answers210
viewsA: SELECT calculating note average in Mysql
Perform the following key joining operation and applying the AVG and GROUP BY functions: SELECT nome, AVG(nota) AS 'media' FROM locais L INNER JOIN notas_locais NL ON L.id = NL.id_local GROUP BY id,…
mysqlanswered Luis Alberto Batista 1,002 -
1
votes2
answers28
viewsA: jQuery rereading in Select
For your javascript I would suggest something like below, because I saw that you have difficulties to generate html code within javascript. $("#idRede").on("change", function () { $.ajax({ url:…
phpanswered Luis Alberto Batista 1,002 -
1
votes2
answers54
viewsA: Because you may be causing error when comparing two dates in php
This form below will transform your string into a date object, and so you will make comparisons more securely by comparing numerical representations like timestamp. <?php // Objeto que representa…
phpanswered Luis Alberto Batista 1,002 -
0
votes2
answers905
viewsA: How does PHP foreach work?
The way for you to "surround the chicken" is to call the actual address of each iterated value &$item, not your copy $item. And this is not by looking at the array itself, but for each iterated…
-
0
votes2
answers50
viewsA: Date problem: 1919/1010/20181818 03:15:16 PM
Try something similar to this example to work with dates. // Definindo dados de teste aqui ou mandado via formulário. $_POST["Data"] = "19/10/2018 16:30"; // Define a sua zona geografica.…
-
0
votes3
answers147
viewsA: How to exchange an image for Javascript
In the head of the page where the javascript will be <script src="local/do//jQuery.js"></script> In the context of HTML / Who shows the image <img id="imagemPerfil" alt="profile…
-
0
votes3
answers97
viewsA: Relationship between the tables
You can use the code below, because I don’t think there will be a scenario where you keep only one branch in stock without product, or a product without an affiliate. For WHERE to work, just put the…
-
0
votes2
answers215
viewsA: How to turn JSON_ENCODE from PHP to JSON in javascript
In the context of your php $suaVariavel = json_encode($seu_Obj_ou_Arr); print($suaVariavel); In the context of Javascript $.getJSON(url.php, parans, function(respJson){ // Aqui você acessa seu json…
-
7
votes4
answers324
viewsA: Interpretation of loop of repetition
The narrative would be, b begins execution with -2, and while b is less than c, which in this case is worth 7, or a is true (true), the code from within the repeat loop runs, testing the following…
-
0
votes1
answer30
viewsA: Generate batch accounts with corrupted date
I created this class to use for cases like this yours, where we have to manipulate date. /** * Responsavel pela manupulação de datas e horas no sistema. * @author Luis Alberto Batista Pedroso…
-
0
votes2
answers1712
viewsA: Javascript - Validation of First and Last Names with upper case letters at the beginning
You can create a capitalization method. Give an Uppercase for the first character. this.Slice(1), takes the point with text from second character and gives a Lowercase. Concatenate the data. Return…
javascriptanswered Luis Alberto Batista 1,002 -
0
votes1
answer52
viewsA: I cannot register a record in the database
Your error is in the SQL variable inside the DAO class, in the insert method, where you generate the fields for insertion, and when skipping line and concatenating the query data, forgot to put a…