Posts by Bins • 3,586 points
229 posts
-
0
votes1
answer30
viewsA: How can I solve this equation in SQL? X = (A - (B+C+D+E))
I see that this error message must be being generated by these lines SET @DIF = (SELECT (ESTOQUE_MIN-(ESTOQUE_ATUAL+COMPRAS_ENTRADAS+CONSUMO_PRODUCAO+ENTRADA_PRODUCAO)) FROM #ESTOQUE_DIFERENCA) SET…
-
0
votes2
answers58
viewsA: Data conversion in SQL server after using in Where clause?
If you will filter through the duedate field of the Purchaseorderdetail table, and this field is datetime, you can filter by date range using BETWEEN. The filter by the date range you entered would…
-
0
votes1
answer18
viewsA: I’m having trouble exporting CSV file in PHP
What happens in this case is that after generating the attachment and changing the headers of the request to download the processing of the page is not terminated, so comes out a file with CSV +…
-
0
votes1
answer14
viewsA: How to create an endpoint that downloads a local file as soon as requested in Nodejs?
If you are not using Express, to download a local file you can do so: const http = require("http"); const port = process.env.PORT || 5000; const fs = require('fs'); http .createServer((req,…
-
0
votes1
answer50
viewsA: React Native - button a js file calling a function or variable in another js file
You can send the function as props to your Header component. To do this, in the construction of your file "Main", you can bind the function you want to use. In the example below, the "Main"…
-
0
votes1
answer45
viewsA: React Native error "Cannot read Property 'navigate' of Undefined onPress
What happens is that the props "navigation" will exist only for the screens you reported when creating your routes. If you for example have a "home" screen in your route file, and it has a component…
-
-1
votes2
answers30
viewsA: PHP - Page updates non-stop
According to your code, the "$Row" variable does not store the total query records. It is an array created during the iteration of the results made by foreach. You would need to change your code in…
-
0
votes1
answer327
viewsA: PHP Compound Interest Calculation
You need to adjust your logic. If I take the initial amount as 7000 and make monthly investments of 500 at 15% interest, in the first month the 15% will be on the initial amount (7000), and the…
-
0
votes1
answer23
viewsA: SQL - How to list only records that have more than one daughter table
To get this result, as commented, you need to first do a grouping and then use HAVING to filter the results. Your query would look like this: select f.NomeFunc as "Funcionário" from Funcionario f…
-
-1
votes2
answers43
viewsA: How can I turn a string of numbers into a Matrix?
In this case, what you would need to do is the following, when you get the "rowResult", you get a string where the numbers are separated by spaces. If you replace the space by comma, you will arrive…
-
0
votes1
answer31
viewsA: Doubt about SQL
To solve this problem there are two alternatives. The first would be to make the queries separately and use UNION ALL to join the results of the two tables. The query would look like this: SELECT…
-
1
votes2
answers124
viewsA: How to update some fields of a table
What may be occurring is that the variable "user" has the content returned by " await User.find(email);" const user = await User.find(email); If the user is not located, the "user" will not update…
-
1
votes1
answer736
viewsA: Typeerror: Cannot read Property 'navigate' of Undefined
From what I’ve seen of your code, what happens is the following, the props "navigation" will only exist for the pages you reported in your route file. Looking at your "Routes.js" file,…
-
0
votes2
answers219
viewsA: Questions when returning data from an API to html?
From what I saw of your code, there are 2 problems, the first is that to read the return of the quotation (in the json variable), you need to do "quotation.USD_BRL" to access the result. The second…
-
0
votes1
answer63
viewsA: Select SQL SERVER PDO data for a select list with PHP
This you can do using Javascript. Here is an example: <select id="combo" onchange="selecionar()"> <option value="0">Selecione...</option> <option value="1">Valor…
-
0
votes2
answers211
viewsA: Form with dynamic inputs in JS and PHP - I’m only getting the last field
You can rename the fields by putting "[]" at the end, this will make the field be interpreted as an array. After posting the data, you can retrieve the field and do a "foreach" to list all your…
-
0
votes3
answers201
viewsA: NOTICE Notice: Undefined index
What happens is that the variables that have the name "question1" until "question8" receive the content of a form field of the same name, sent through the method "POST". When opening the page, the…
-
1
votes2
answers53
viewsA: Saving the value of the label on the bank with javascritp
According to your code, the "total" input text can receive a value that changes according to the type of delivery. The problem is that the value has "R$" in the beginning. If the database field…
-
0
votes1
answer69
viewsA: How to block the suggestion list of an input text?
Input fields have an "autocomplete" property, you can disable to eliminate this behavior <input type="email" id="email" name="email" autocomplete="off"> More information:…
-
1
votes1
answer1041
viewsA: Take data from an editing form - React
From what I saw from your example, the API receives the data from "initialValues", but the data that would be updated would be in the state. I see a problem with the state update, since you save all…
-
0
votes1
answer25
viewsA: problems with php header
If you open the direct page this will occur because the contents of the session "name" and "password" is loaded through a POST content (which did not occur). This is why the error of "Undefined…
-
1
votes2
answers271
viewsA: getElementById in React/JSX
One of the ways to solve this would be to create a component with state. You could create a variable in the state and save in the state the value of the "input-url" when it is changed. This way, by…
-
3
votes1
answer50
viewsA: Select from a column argument with multiple arguments
You first need to locate the first occurrence of the comma, and select the characteristics up to the position where it lies. To select part of a string, you can use the subtring function, to find…
-
0
votes1
answer612
viewsA: Typeerror: Undefined is not an Object (evaluating 'this.sound.playAsync')
What happens is that "sound" does not exist within your "Buttonsmanager" class. What you can do is save "sound" within the state. Your code would look like this: import React,{ Component } from…
-
0
votes1
answer28
viewsA: Problem with SQL return
Considering the structure of your table, to know the Ids of clients that appear more than once in your table "request", you could do as follows select cliente_id from solicitacao group by cliente_id…
-
0
votes2
answers444
viewsA: How to authenticate user using your Google account in an app built with Expo (React Native)?
You can install a dependency called "expo-google-app-auth" expo install expo-google-app-auth After installing, you can extract the access_token as follows: import * as Google from…
-
0
votes2
answers295
views -
0
votes1
answer37
viewsA: SQL, search only one element per category
If I understand correctly, you want to return your categories and only 1 record each. This you can achieve by making a base query that returns the last registered ID to a category SELECT MAX(id)…
-
1
votes1
answer1522
viewsA: how to style an icon inside input in React-Native
From what I saw of your code, the "search" style is correct, when you define a Direction as "Row" and define the alignment as "space-between", if you have two elements, the first goes left, the…
-
0
votes1
answer31
viewsA: re-act giving error
The error must be on this line user[user.target.name] = event.target.value; /* usa nome do input procura propriedade ,diz os atributos ,setou valor do input*/ The function is not receiving a "user"…
-
1
votes1
answer29
viewsA: Query optimization
Something that would be interesting would be to have this information that you filter in the "like" in a separate field. Subselects take as a basis the year and month of the main query, you can…
-
-2
votes2
answers263
viewsA: Assign a database value to a php variable
If your intention is to retrieve the last record from the table, you can try it as follows: <? $host = "localhost"; $user = "root"; $password = ""; $database = "nome_do_banco_de_dados"; $dblink =…
-
-1
votes2
answers696
viewsA: How to upload the contents of a variable to the backend using javascript fetch?
If error 500 is occurring, then there was some problem with your backend, looking at the code, it may be that the "idfilial" did not reach it. Try to do so, if the problem persists, check what is…
-
2
votes1
answer141
viewsA: "Can’t perform a React state update on an unmounted Component" when I try to change the state in useEffect
One of the ways to avoid this problem is to create a variable to control whether the component has already been loaded before trying to return the data from your localStorage, try the following:…
-
0
votes1
answer24
viewsA: When filter no record appears in the table
To search by date in the database, you need to enter the date in the aaa-mm-dd format, for example, if you type the date as "05/03/2020" the search will not work, you would have to enter the date as…
-
1
votes2
answers206
viewsA: 1 select with two columns
As the date range and the same, you can make a SUM using a CASE WHEN , this way you get the results in separate columns. According to what you posted, the query would look like this: SELECT SUM(case…
-
0
votes3
answers99
viewsA: List with Jquery, second JSON index
Since the event is an array, you can access its contents as follows: $.each(volta.ocorridos, function(index, obj) { console.log(obj.data); console.log(obj.hora); console.log(obj.onde);…
-
0
votes1
answer841
viewsA: How to create routes using google maps and PHP?
Assuming you have the coordinates of origin and destination in hand, the easiest way to do it would be as follows:…
-
3
votes1
answer282
viewsA: Save user latitude and longitude in variables
If you want to capture coordinates only once and reuse on other pages one of the alternatives is to use the browser’s localStorage. You can also choose sessionStorage. Both store the information in…
-
2
votes2
answers61
viewsA: Javascript function to return 3 separate values
What you can do is this, in your PHP (visualize.php), instead of returning a string with the table, return a string with comma separated values. Example: $resultado="codigo,tipo,status"; echo…
-
1
votes1
answer155
viewsA: History does not work
"History" exists as a props for components that were informed when creating a route. If for example you have a "/Register" route that is linked to a component with the same name, using it would look…
-
0
votes1
answer85
viewsA: How to condition select in another table row in Mysql?
Taking his example with the CPF "10000000zzz", schooling in 2003 was higher than in 2005. 2003 10000000zzz 7 2005 10000000zzz 6 If you want to catch this kind of inconsistency, I would recommend you…
-
0
votes1
answer105
viewsA: How to take all pages of an API and show all data at once on screen using React Hooks?
When you do the "for" to loop and query the other pages of the API, you save the result within the state "characters", then it always deletes the previous value and writes only the current call, why…
-
0
votes1
answer285
viewsA: React Native upload image network error
By the description of your error, the problem may be in your backend, there may have been some problem with the answer, so it fell in the "catch". One way to try to identify the problem is to print…
-
0
votes2
answers1049
viewsA: innerHTML at React
You can install a library, but what it will do is facilitate the use of dangerouslySetInnerHTML React-Inner-html npm i -S react-inner-html Example: import html from 'react-inner-html'; function…
-
-1
votes1
answer888
viewsA: Error trying to post on Mongodb with Insomnia
From what I saw of your code, the error occurs before recording on Mongo, the reason for the error is that it did not load "techs" from the body of your Request post. You can confirm this by…
-
5
votes1
answer1390
viewsA: How can I change only one property of an object using the useState hook
You can use the Operator spread when updating the value in the State. It would look like this: setValue(prevState => { return { ...prevState, value1: "novo valor" } }); This way the value2…
-
0
votes1
answer168
viewsA: Error trying to log in with React and Redux Saga
I did a test using Postman, doing a post for the address that appears in your error print: https://charler-node-api.herokuapp.com/auth/token I set the header as basic Authentication, using the…
-
0
votes2
answers904
viewsA: Styling the page header with createAppContainer and createMaterialTopTabNavigator
There are two ways to solve this problem. The first would be to configure the "navigationOptions" of each route within its "mainNavigation". Here is an example: const mainNavigation =…
-
1
votes1
answer651
viewsA: Method error The GET method is not supported for this route. Supported methods: POST
I recommend you make two adjustments, the first in your route file, change the route of Authentication to stay as follows: Route::post('/authentication',…