Posts by Bulfaitelo • 1,684 points
93 posts
-
0
votes0
answers88
viewsQ: Update span in Chart.js Component Graphic Display Event
Hello, I’m creating a component in Vue.js to generate a group of dynamic charts, the values are still static, because I am still shaping. The current problem is I want to be able to update a…
-
1
votes1
answer157
viewsA: Update Fields Using Checkbox - Laravel
The easiest way I think would be to use the Laravel Collective (however it is being reshaped temporarily is out) But we go in the most manual form: @foreach ($esportesas $item) <label…
-
1
votes1
answer953
viewsQ: What’s the difference between using type="text/javascript" or not?
I’m studying Boostrap 4 and in one of the classes when setting up a carousel I noticed with the addition of type="text/javascript" to my <script>, the doubt is as follows, what is the function…
-
0
votes2
answers121
viewsQ: Arithmetic operations in PHP or Mysql?
What would be the good practice when doing arithmetic operations that come from a database query, for example: SELECT valor_bruto_atual, valor_investido, (valor_bruto_atual / valor_investido) AS…
-
1
votes1
answer109
viewsA: Eloquent mapping, is it?
There must be several ways to do this, I will respond with use that I believe is the best way, Add the second connection on to your config/database.php: 'mysql_secondary' => [ 'driver' =>…
-
0
votes2
answers188
viewsA: List data from two unrelated tables in the same view
Change the method create(): <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Estado; /** * * code.. */ public function create() { $retornoAllEstado = new Estado::all();…
-
0
votes1
answer32
viewsA: Javascript value is not summed
I believe it is because you are adding strings and consequently Javascript will concatenate them. Test the shape down: var ano_carro = document.getElementById('ano_carro').value; var condicao_carro…
-
5
votes1
answer211
viewsQ: Mysql use 'as' in aliases or not?
Writing a query in Mysql I came across this doubt, I made a search, however, I found nothing (or did not know how to look for), the doubt is simple, there is some difference between using or not the…
-
1
votes0
answers59
viewsQ: Error updating mysql server on linux Mint
I have a machine with Linux Mint which I use as my development server, which is working normally, however, when performing an update (apt-get upgrade) of the installed packages, the mysql server…
-
1
votes1
answer76
viewsA: PHP Error Message After Login
In your case you will need to work with the $_GET[] for example: <?php if($_GET['login'] == 'erro2'){ ?> <div class="text-danger"> Utilizador ou senha inválidos </div> <?php }…
-
1
votes1
answer93
viewsA: A variable in my while is not adding up
I don’t know if it’s the best way to solve your problem but it’s the only way I can think: import os,time matriz = [] count_value = 0 def count(count = False): global count_value if count == True:…
-
1
votes1
answer242
viewsA: Catch Variable Combobox PHP
See if this solves: <?php $dbconn = mysqli_connect('localhost','local','x','dblocal'); $query = "SELECT AcoesReinc from DescAcoes"; while ($registro = mysqli_fetch_assoc($consultaslot)) { echo…
-
0
votes1
answer56
viewsA: Database error that appears when updating the page - SQL server
To change user settings for SQL-Server, just rotate the following command: ALTER DATABASE DATABASE_NAME SET MULTI_USER; GO If an error occurs while executing a command, accusing a user is already…
-
0
votes2
answers63
viewsA: Create a price change button
I don’t know if this is exactly what you need, but I used jQuery with some functions, .change(); so that when changing the value of the select it is executed. a .text(); to update the span in…
-
2
votes3
answers399
viewsA: pass javascript variable to a php variable
For this you will need to work with ajax, who makes requisitions http asynchronous form; $.ajax({ url : 'caminho_do_php_que_ira_recebe_o_input.php', dataType : 'html', type : 'POST', data : {'id' :…
-
2
votes1
answer56
viewsA: How to improve QUERY
The only thing I could think of to optimize your code is to remove the rand() and place after the union, because I believe he weighs the most. I believe that executing it only once is better than…
-
2
votes1
answer5532
viewsA: In a file . bat (Batch) how to rename a file using variables such as %userprofile%?
Understand that the command REN and the RENAME, do not work as the command mv of linux (where you define the path complete to move or rename). In the REN you need to enter the source file path in…
-
1
votes2
answers658
viewsA: How to insert an array in a column of the Postgres array type with Laravel/Eloquent?
Hello you can use the method insert() and do as follows: $leituras = new Leituras(); $leituras->insert([ ['ids_autores' => 20], ['ids_autores' => 15], ]); You in this case pass an…
-
2
votes1
answer206
viewsA: How to use mysql zerofill in Laravel Migrations?
There is no method for this in Migrations of Laravel, but you can use the class **DB**, for example: Schema::table('tabela1', function (Blueprint $table) {…
-
0
votes1
answer151
viewsA: Invalid method (HTTP Verb) is being used Error
I added the fear of sending the type $_POST[] so that when sending by POST he works on top of the temporary file. I didn’t notice and understand all your script, but only in the middle of post, I…
-
1
votes1
answer187
viewsA: Set directory to subdomain via HTACCESS
Follows the possible solution. <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^teste.site.com.br$ RewriteRule ^(.*)$ pasta/$1 [L] </IfModule> Test it and tell me, if…
-
1
votes2
answers80
viewsA: Converting PHP Data to pt_br format
To print in Brazilian format just use the date(); format: date('d/m/Y'); Where d/m/Y are respectively Day Month and Year In the Link the information of the possible parameters, which is also usable…
-
1
votes3
answers49
viewsA: Validate form and send email
I set up a base to help solve your problem, you can use the submit(); and use a basic logic of checking false return, when a return false; he will not submit the form if no return false he submits…
-
1
votes1
answer91
viewsA: 301 htaccess redirect with and without www to HTTPS
To redirect all traffic to Https just add this line in your .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$…
-
1
votes3
answers42
viewsQ: Keep images online even on mobile devices
I have a div which contains some icons, which are aligned horizontally, but according to the size of the screen on which it is displayed a line break is generated, my goal is to prevent this from…
-
1
votes1
answer444
viewsA: Error when running php Artisan migrate
The problem occurs in the method number();, because it does not exist, as the columns you are using is intended to CPF or RG can use string(); same, or if it is only numbers (without the points and…
-
1
votes1
answer401
viewsA: Mkdir(): Permission denied on Windows
Your problem is related to directory permission, and for this you can use the command cacls from the terminal to this (similar to chmod from linux), for example: CACLS *.* /E /T /C /P todos:F CACLS…
-
0
votes1
answer91
viewsA: Can I pass 2 Laravel array_encode?
Try to pass the Return in this way: return view('home', compact('notasEntrada', 'notasSaida', 'valorNotasEntrada', 'valorNotasSaida'))->with('nome', json_encode($array))->with('estados',…
-
1
votes2
answers343
viewsA: How do I get the latest date by following a SQL filter?
Follow the query: SELECT ex.gsm, ex.motivo_envio, ex.status, ex.data_ativacao, ex.data_importacao, ex.data_alteracao FROM (SELECT gsm, MAX(data_alteracao) AS last_date FROM export GROUP BY gsm) lst…
-
1
votes2
answers418
viewsA: Spam in the contact form
The isset(); check if the variable was started, even if it is empty it will be started, so always the condition you created will not work, what you can do is the following, change the isset(); one…
-
4
votes3
answers769
viewsA: Table button to update the row
What you can do is pass the parameter inside the function, certainly when you mount this button you get this parameter, then just pass inside the function in the onClick that it will receive this…
-
0
votes1
answer290
viewsA: Process manipulation with Javascript
You can kill the process by its name and even if there are several of it it will finish all, for example: taskkill /im /f firefox.exe The parameter /imdetermines a process name and parameter /f…
-
0
votes1
answer73
viewsA: File not found error while moving image in Laravel
Doing the tests I ended up solving the problem, so I understood the function storage_path(); and the method Storage::move(); by default they already work inside the directory storage/. For example,…
-
1
votes2
answers1849
viewsA: Create Controller in a specific folder in Laravel?
Basque set the directory where you want to create the controller, for example: php artisan make:controller test/testController The controller will be created inside the directory test/ If you have…
-
2
votes2
answers1940
viewsA: Deploy Laravel application
We will do an installation from scratch of your project, (I believe it is the best way): Access your project from the terminal ssh, navigate to the directory www (usually stays within /var/www/)…
-
0
votes1
answer73
viewsQ: File not found error while moving image in Laravel
I’m trying to move an image that’s located inside storage/temp for storage/app/public/erro_log with the method Storage::move();, but I get the error of File not found, even if the image is at the…
-
3
votes1
answer527
viewsQ: Problem with special python characters
I have a bot made in Python with the Selenium webdriver, which takes some data from Tesouro Direto and generates a json, however I am facing a problem, which occurs when a special character appears.…
-
0
votes1
answer78
viewsA: Submitted form, returns Class not found autoload Composer
Your problem is related to the loading of 'vendor/autoload.php';, it is necessary to load it, as you are working with distinct php files it is necessary, and in your case just add it in login.php:…
-
0
votes1
answer446
viewsQ: Instantiate class in method parameter or within method
Working with an Laravel controller I came across something similar to this: public function show(Role $role) { // é apenas um exemplo. } Where the Role class is instantiated in the variable $role…
-
0
votes1
answer99
viewsA: Create . JSON file based on the result of the SQL query
I made him walk the $result to generate a vector to be converted by the function json_encode(); work: <?php $connect = mysqli_connect("localhost","root","admin","opcuaserver"); $query = "SELECT…
-
3
votes2
answers3180
viewsQ: Finish process and open again by . bat
My problem currently is the following, I have an executable that has the function of employee access control, but due to some problem in this process it usually stops responding, with this I built a…
-
0
votes1
answer535
viewsA: Search records between two dates using the eloquent of the Standard
According to what I was reading on documentation the WhereDate(); it only compares dates and not the timestamp, for example it would be the same thing as putting a where DATE(created_at) >= ....…
-
1
votes1
answer34
viewsA: Return last result (updated by date) of each attribute
The best way I can think of you doing that is to do a second select within the where to determine the last date. SELECT atributo, valor, data_atualizacao FROM config WHERE data_atualizacao = (SELECT…
-
0
votes2
answers456
viewsA: block access to a particular directory via htaccess with password
After a little search, I ended up finding the solution to my problem, so I came to share with the community, (which was even better than I expected) .htaccess: # bloquando leitura do .hacess…
-
1
votes1
answer584
viewsA: Timer in PHP calling Function
You can make use of the crontab, just set the time and the file php what to call; for example: * * * * * root php /path/file.php >/dev/null 2>&1 This script will run every minute, and…
-
0
votes1
answer138
viewsA: How to maintain filters after paginate and Submit
Hello, for ease I’ve always used appends();, with the use of $request->input();, That is, anything sent on request will be added in the pagination url, you can set in hand each one, but it is at…
-
0
votes2
answers456
viewsQ: block access to a particular directory via htaccess with password
I currently have a server where I leave my web projects running, some of them in Laravel, so far without problems, however I want to create a password restriction on .htaccess to the root, For…
-
0
votes1
answer25
viewsA: Why does php not return the extension of all images when renaming it?
You can use the function pathinfo();: pathinfo - Returns information about a file path $path = $_FILES['userfile']['name']; $extensao = pathinfo($path, PATHINFO_EXTENSION); $nomenovoorigem =…
phpanswered Bulfaitelo 1,684 -
0
votes1
answer180
viewsA: Make a bank GET from an Laravel Array
You instead of using Where(); you could use wherein(); For example: return $this->produto = DB::table('produtos') ->where('id_admin', $array_id) ->get(); Where is this $array_id would be an…
-
2
votes2
answers88
viewsA: send 2 variables by url
Hello, I created 3 conditions so that if the variable values $Nome $CodigoUtente there is no query for your query, basically it was a few ifs that determined whether the query would or would not…