Posts by adrianosmateus • 755 points
32 posts
-
1
votes2
answers83
viewsA: How to make a CASE WHEN for named expressions?
Put a AS (AS "means alias, we can call another name a given table or column using an alias") before MARGEM ROUND(NFI.NOTAFISCALITEM_VALORMARGEMGERENCIAL, 2) AS MARGEM…
-
1
votes3
answers3768
viewsA: Using Redis in practice
I run a website development platform and use Redis and Mysql on it. Mysql, of course, stores all the system data, including the data that renders the websites. But why then do I have a redis…
-
1
votes1
answer25
viewsA: SELECT in PHP only returns from the second INSERT of the same user
The mysqli uses a cursor to control the items you recover through mysqli_fetch_assoc that advances 1 item every time it is called, and as you have already given one mysqli_fetch_assoc there in…
phpanswered adrianosmateus 755 -
0
votes1
answer785
viewsA: How to insert foreign keys in PHP, so I can have a control when pulling the VIEW
If I understand your question correctly, just play the id to be written to the foreign key inside the query: //Caso não ocorra nenhum erro, permita que os dados sejam inseridos no banco. if ($row ==…
-
1
votes1
answer259
viewsA: SQL SCRIPT PROJECT
Let’s go to some things I’ve observed. The id of your table situacao is without type, so change the declaration of that id to id_situacao INTEGER NOT NULL. The column id_socio on the table carro is…
sqlanswered adrianosmateus 755 -
1
votes1
answer2283
viewsA: Symbolic link does not work on Laravel
When you create the link to your public website, access to it becomes via <host_do_projeto>/storage/<nome_do_arquivo>, that is, if you upload a file to your public archive as foo.txt,…
-
1
votes1
answer68
viewsA: View all records in a column
This is happening because with each repetition of the while, your code rerscribes what is in $tec_login, so it will only show a record. You can concatenate everything into that same variable or save…
-
1
votes1
answer615
viewsA: MYSQL Time range
Your select returns this because CURDATE only returns the current date without the time. Use NOW() in the calculation as it returns current date and time: SELECT datas FROM banco WHERE datas >=…
mysqlanswered adrianosmateus 755 -
1
votes3
answers97
viewsA: Relationship between the tables
Just add the branch table in the clause FROM and add the parameters for filtering in WHERE, without too much complication: SELECT E.COD_PRODUTO, P.DESC_PRODUTO, E.QT_DISPONIVEL, E.COD_FILIAL FROM…
-
0
votes2
answers38
viewsA: Default of HTTP request
In your case, use another route/request GET. Note that the technical description of each verb makes its functions clear, and taking this into account, the GET is the type of call to be used when the…
-
0
votes4
answers1661
viewsA: Redeem name and show in option through id
Supposing that your <select> and consultation sql are in the same file and that you are using the plugin mysql of php5 as quoted in the question: <?php /*Conexão com base de dados e…
-
4
votes1
answer1684
viewsA: Confirm PHP password, Javascript, HTML
This is happening because you’re calling the $statement->execute($valores) before the checks. Therefore the records will be entered independently of what the checks verify. Try to relocate this…
-
2
votes1
answer45
viewsA: Detect field type sent in PHP POST
There is the function gettype() that returns a string that identifies the type of data that is the variable passed to the parameter, even if it is an array. You can use this to handle your code. For…
-
1
votes2
answers129
viewsA: Best way for database normalization
In their case the best solution would be in fact the normalization, with tables interconnecting the columns in common, mainly aiming at maintenance. Imagine in a case where there would have to be a…
-
3
votes1
answer1135
viewsA: Print Mysql Table data in PHP
You are only passing a parameter to the function mysqli_query() which is the query itself. The correct being to pass a connection variable followed by the query: $conexao=…
-
8
votes1
answer518
viewsA: How to insert emoji character into a MYSQL TEXT field?
Use the "utf8mb4" charset. It will support storing the representation of the emoji string and other things that a common charset does not support. You can use an alter similar to this one if you…
-
0
votes1
answer57
viewsA: UPDATE IN MYSQL
Without the table creation script there is no way to know how many characters the "password" column supports, but the error indicates that the value being assigned to the field has a larger number…
mysqlanswered adrianosmateus 755 -
0
votes1
answer171
viewsA: fopen and fputs for Amazon S3 by Laravel
I was able to solve the problem without using fopen/fputs, just by taking the return of curl_exec and using it in the file Storage of the file for storage: private function FileUpload($path, $url){…
-
0
votes1
answer171
viewsQ: fopen and fputs for Amazon S3 by Laravel
In php, is it possible to send an image file, obtained by returning a request by Curl, directly to a S3 Bucket using Laravel methods? If yes, how to do?
-
0
votes2
answers101
viewsA: How do I get the value of a specific form from the previous page in PHP?
Each page form, regardless of how many are submitted, is submitted individually. So, if you have two forms and each one has your Submit, only the form in which Submit was triggered will have the…
-
0
votes1
answer57
viewsA: Quotes closing improperly js
The problem ai is that in this place where ta giving error should be single quotes for the fact that the string passed in the JS is open as double quotes. To avoid conflict with opening quotes from…
-
2
votes1
answer45
viewsA: Basic Commands
Since no information was passed on to the structure of the case, a more "standardized" example to address the doubt would be: UPDATE funcionario SET funcao = 'Gerente de programação' WHERE funcao =…
sqlanswered adrianosmateus 755 -
1
votes3
answers750
viewsA: Space occupied between different types of integers
In the case of ints, the entire space of the int variable is allocated even if its value is 1 or 100. There are even sectors in large developers that evaluate what is the most viable way to declare…
-
3
votes1
answer72
viewsA: Mysql table with performance problem (Too slow)
Create indexes pointing to the most commonly used fields as the search parameter and if so, make sure that foreign keys are properly referenced. The importance of the existence of indices and…
mysqlanswered adrianosmateus 755 -
0
votes1
answer485
viewsA: Laravel - Insert to database
You are starting and closing the sql script with simple quotes (') and every varchar value you will insert also uses simple quotes. This makes php interpret that every single quote you use is…
-
0
votes2
answers47
viewsQ: More than one value in the same GET parameter
It is possible to assign more than one value in the same GET parameter via http, as if I had passed an array in this parameter? For example: http://www.exemplo.com/buscar?campos=nome,data,endereco…
-
0
votes0
answers89
viewsQ: File common functions between various projects in Laravel
I’m developing a large web project, a project that is a cluster of sub-projects programmed in Laravel. Naturally, this project has many common functions to be used among several files and classes of…
-
0
votes1
answer29
viewsA: Difficulty recovering data from a link in Laravel
I was able to solve the problem using Javascript, taking the data from the hash using "Location.hash" and then removing "#access_token=" using replace to finally isolate the final value I wanted to…
-
0
votes1
answer29
viewsQ: Difficulty recovering data from a link in Laravel
I am developing an application with the Laravel framework along with the instagram api and I have reached an impasse: in a given routine, I get a redirect that returns the login to my application,…
-
2
votes2
answers56
viewsA: How to select in a table as if it were two records
I believe this select can help: SELECT a.nome AS aluno_nome, r.nome AS responsavel_nome FROM pessoa a, pessoa r, responsavel_aluno ra WHERE r.e_responsavel = true AND a.e_aluno = true AND ra.aluno =…
-
0
votes2
answers637
viewsQ: Redeem id passed by URL without using GET
I have a question that I believe is simple for almost everyone, but I did not find any material that really help me to solve this. I am developing a micro-service in php that has as its sole…
-
3
votes1
answer1824
viewsQ: How to request a digital certificate and use the public key to sign a string?
I’m developing a web site for my TCC at php, and I’m at an impasse: My application will need to request a digital certificate, which may be the file .cer or load from the user’s repository and sign…