Posts by Marco Aurélio Deleu • 1,495 points
31 posts
-
2
votes1
answer26
viewsA: .each() ends when the div is closed
You will need to use 2 .each to obtain the expected result. $('.grid-f).each(function(index,value){ jQuery(this).find('.col-4').each(function(index,value) { if((index%3)==0){…
-
5
votes1
answer657
viewsA: Randomized and ascending order query in MYSQL
One way to achieve the result you expect is to use sub-query. SELECT * FROM ( SELECT * FROM `aluno` ORDER BY RAND() LIMIT 0, 5 ) as alunosAleatorios ORDER BY `AlunoPontos` ASC Thus, the internal…
-
1
votes1
answer83
viewsA: How to automatically include a file, which is not a class, in Composer?
You can also include arquivos in Composer: { "autoload": { "files": ["src/minhaBiblioteca/functions.php"] } } This way, Composer will ensure that files defined as files under the directive of…
-
2
votes1
answer768
viewsA: getUserMedia has now been discontinued on non https connections?
The Chromium project announced this change to adapt to the new W3C standard that determines that any powerful resource limited use through secure authentication environments. The W3C itself admits…
-
15
votes4
answers16259
viewsA: How to use Progressbar with Ajax and PHP?
Fundamentally, your problem lies in determining how long it will take the server to respond to your request. The problem with the solutions that depend on Xmlhttprequest is that you can only measure…
-
4
votes1
answer324
viewsA: Initial Value Sequences Postgresql - Laravel 5.1
The problem is in your Seeder: public function run() { Model::unguard(); App\Models\Admin\Profissao::create(['titulo' => 'Engenheiro(a)']); App\Models\Admin\Profissao::create(['titulo' =>…
-
1
votes1
answer154
viewsA: Is it impossible to do trucate to a table with Foreign Keys even if it is empty?
Although there is no reason to want to truncate an empty table, the error happens because truncate is different from delete. As you are using foreign key, it is likely that you are using InnoDB,…
mysqlanswered Marco Aurélio Deleu 1,495 -
3
votes3
answers1439
viewsA: While inside another While (PHP - SQL)
the command mysql_fetch_assoc() is the command that acquires a record from a executed query. It needs to be run iteratively: while($row_busca_forma = mysql_fetch_assoc($Busca_busca_forma)){ // Faça…
-
2
votes1
answer1996
viewsA: how to configure the eclipse IDE to fully read a 5 Standard project
In the package explorer menu (Package Explorer), at the top right has an arrow pointing down call View Menu (just hover over to see the Tooltip showing the name of the button). In the menu that…
-
3
votes3
answers9183
viewsA: How to reset Mysql auto-increment?
Your problem (and you NAY is alone) is a simple TOC due to deleted records. The recommendation is always not to worry about the gaps that Mysql ends up leaving, because the id column was not made to…
-
1
votes1
answer904
viewsA: Single record with 2 fields verification - Laravel 5.1
From Laravel 5.0+, you can use composite key as follows: 'nome' => 'required|unique:{TABELA}{COLUNA}{EXCEÇÃO}{ID} Following that specification of the documentation, I believe your case would look…
-
3
votes6
answers22035
viewsA: Compute the rest of a decimal division in Javascript
I’ve read all the answers and I haven’t seen one sticking to the root of your problem. Your problem is not really in Javascript (or programming), but in the mathematical logic behind the operation…
-
2
votes2
answers824
viewsA: PDO - Problem with Fetchall
You are running multiple queries with PDO, which is usually not supported. The first query consists of set @row_number = 0; (note the ; at the end of statement) and the second query is SELECT…
-
0
votes2
answers327
viewsA: Mongodb problem in listing data with php
Try using the following function to establish connection $m = new Mongo("mongodb://DATABASE_USERNAME:DATABASE_PASSWORD@HOST"); $db = $m->selectDB($database); // Connect to Database If you do not…
-
3
votes1
answer2455
viewsA: Folder for Models Laravel 5.1
You will have to change the namespace of the model classes. For example namespace App\Models; If the folder you create is called Models (case sensitive) and is within app. This is because the…
-
1
votes1
answer93
viewsA: Disappear two Ivs with jquery
Place Modal inside the article div <div class="artigos" id="artigos"> <?=$artigo['artigo_id']; ?> <h1><?= $artigo['frase']; ?></h1> <a class="chamar-moldal"…
-
3
votes1
answer103
viewsQ: Why is Nan bigger than any number?
A practical example of this statement is: parseInt(50) > parseInt('a'); When running this operation on a console, for example, the result is false. The real code that brought me to this question…
-
1
votes2
answers89
viewsA: Mysql, help to understand data export
The problem is in the export template. Phpmyadmin offers you different types of exports, such as __DB__ and __TABLE__, for example. Each template brings a different format. The second format is for…
-
5
votes3
answers153
viewsA: Database with php
The problem is that you are writing the name out of the repeat loop. The term "while" means "while" and represents a repeat structure. In this case Enquanto houver registro no banco de dados, faça:…
-
2
votes2
answers625
viewsA: Interacting with multidimensional array - PHP
If you are using PHP 5.5 or higher, you can take advantage of the function array_column. $result = array_column($total_array, 'id'); And so simple will have the expected result. For versions prior…
phpanswered Marco Aurélio Deleu 1,495 -
1
votes1
answer81
viewsA: Doubt about LAMP development environment with Vagrant and provisioning with Puppet
In a development environment with Vagrant, is it necessary to install a version control system like GIT within the VM? If so, why? It depends. Vagrant has a basic functioning of sharing a folder on…
-
3
votes1
answer2741
viewsA: Login/Authentication with Angularjs and PHP
I suggest you study more about data-driven applications. You don’t have to worry about route security at the frontend because it does not exist. Angularjs is an excellent tool to create Single Page…
-
3
votes2
answers604
viewsA: Relationship on-to-one in auxiliary table using Laravel
I wouldn’t misjudge the way your database was modeled. In fact, your structure is already prepared to accept more than one address per user and/or link an existing address to a different user.…
-
7
votes1
answer1501
viewsA: What makes a popup block?
Popups are blocked by browsers when an action is identified window.open (or equivalent) other than apparent be an immediate user action. Older browsers could consider any function stack as a bad…
-
2
votes1
answer823
viewsA: How to send Google Chart by email?
Google Charts are designed using SVG. Some email providers provide SVG reading, others do not. The solution I found was convert SVG to PNG and save the PNG file to the server and include a tag…
-
1
votes3
answers43
viewsA: Name a csv file
Browse the directory of your backups and sort the files by creation date. <?php $arquivos = array(); $diretorio = 'caminho/da/pasta/de/backup/'; $manipulador = opendir($dir); while (false !==…
phpanswered Marco Aurélio Deleu 1,495 -
5
votes2
answers245
viewsA: Check if user changed POST request
Sensitive information should never depend on client-side¹ because Javascript encryption is useless. The transparency offered by current browsers makes all your code and information readable and…
-
4
votes4
answers53244
viewsA: Different ways to count record numbers in Mysql
There is. When you run the SELECT * FROM produtos, In terms of performance you need to wait for the database to load all the data and deliver it to PHP. Then PHP will count the data. Already the…
-
17
votes2
answers2531
viewsA: What is the logical "XOR" operator in PHP? When do you use it? What does it do?
XOR is the operator of OR EXCLUSIVE. It is used when you want to verify the veracity of an expression OR other, exclusively. Example: I have 2 hours a week to study either PHP or JAVA. In this case,…
phpanswered Marco Aurélio Deleu 1,495 -
4
votes4
answers37758
viewsA: What is the difference between "&&" and "||" and "and" and "or" in PHP? What to use?
Operators && and || takes precedence over and and or. This determines the order in which they will be executed. && and || are executed before and and or. Link to the Manual…
-
1
votes2
answers215
viewsA: PHP/Ajax - return Ajax does not bring when if ==
Try quotation marks on the right-angled arrays. if($dados_Subcategorias['codigo_subcategoria'] == $_GET['subCat']){