Posts by Thomas • 1,242 points
25 posts
-
0
votes0
answers99
viewsQ: Refactoring a database using VIEWS
I have the task of refactoring a database and would like to know if VIEWs are viable for the task. My strategy is to create a VIEW imitating the new structure of the supposed table, at least the…
-
0
votes1
answer117
viewsA: recover Datetime in Mysql between current date
Put the data_fim as >=. The way you are doing, the query deletes all dates that are smaller or equal than 2014-10-14 17:44:00 and the remaining set, filters the records where the data_fim is…
-
1
votes1
answer943
viewsA: Bring "children" record count along to all table records
I managed to reach the result by doing a LEFT JOIN in the table itself, joining with the query that had: SELECT cat.*, COUNT(cat2.id) FROM categorias AS cat LEFT JOIN categorias cat2 ON cat2.id_pai…
-
2
votes1
answer943
viewsQ: Bring "children" record count along to all table records
How do I count how many "children" such a row have, and at the same time list all the records in the table? I have the table categorias, with the following data: _________________________________ |…
-
5
votes1
answer805
viewsQ: How to simulate concurrent traffic/access arbitrarily in Apache?
I am using Easyphp 14.1 Devserver, which comes with`Apache 2.4.7/Mysql 5.6.15. I am willing to simulate high traffic and concurrent access to observe the performance and behavior of my site under…
-
7
votes2
answers863
viewsQ: How to include a indent when using the tab key in a textarea?
I have a <textarea> which will act as a small source editor. I wish that, by pressing the Tab, include a indent in the text instead of focusing on the next element, which is the default…
-
4
votes3
answers1773
viewsA: How to bypass an accent in mysql + Php
Copying Based on that response from the OS, you just have to select the fields using utf8 as charset: SELECT * FROM produtos WHERE status_pr='online' AND (LCASE(nome_pr) LIKE _utf8'%$get%' OR…
-
0
votes1
answer1516
viewsA: Creating Charts with JSON and Highcharts
I tested your HTML and what seemed to be the problem that didn’t create the chart is that the Highcharts library seems to have a jQuery dependency, and jQuery is only being declared after…
-
1
votes1
answer156
viewsA: mysqli receiving Boolean
You are going to array $carros for the database table name field, I imagine you wanted to pass the variable $nome instead. functions.php Use Prepared statements to avoid sql injections attack. Read…
-
1
votes1
answer2653
viewsA: Calculation of the average in php
As you have 2 notes in a row, the function AVG will not bring the expected result, because it averages a field based on all records returned from the query. To take the average, you will have to add…
-
3
votes1
answer147
viewsA: Scrolltop after the page has already been loaded
Make sure you are accessing a URL that contains /clinicas: $(function(){ //coloque este código onde quer que você tenha o código que verifica que o DOM está pronto if…
-
1
votes1
answer213
viewsA: My application does not save accented data correctly
It is likely that the transport of Mysql data from the PHP library to the driver is with another encoding. I mean, the page is with the right coding, the database is recording things in UTF-8, but…
-
5
votes2
answers1405
viewsQ: How to make an image divide the text from within a bounded width div?
How to make a <img> break the text from within a <div> limited-width? For example, with this code: <style> #imagem { float:left; } #container { width:250px; background:#ccc; }…
-
37
votes2
answers20576
viewsQ: What are the differences between Myisam and Innodb?
What are the main differences between Engines MyISAM and InnoDB and what is the most appropriate situation for the use of each? I know that MyISAM can’t stand it FOREIGN KEY but supports FULLTEXT,…
-
4
votes1
answer3088
viewsA: Close a php window and update the old one
In the code of your page inc_credor.php, put the following: <script> window.onunload = fechaEstaAtualizaAntiga; function fechaEstaAtualizaAntiga() { window.opener.location.reload(); }…
-
1
votes1
answer150
viewsA: mysql medium time, top 10 templates
Time the POST spent from DATA_ENTRADA to DATA_SAÍDA Sum of minutes that such a POST has spent: SELECT SUM(TIMESTAMPDIFF(MINUTE,DATA_ENTRADA,DATA_SAIDA)) AS tempo_total_posto FROM `OS` WHERE POSTO =…
-
5
votes2
answers975
viewsA: Make a conditional update on ON DUPLICATE KEY
Use the function IF() INSERT INTO registros (NAME, position, price) VALUES ( '$data[1]', '$data[2]', '$data[3]' ) ON DUPLICATE KEY UPDATE /* SE status atual for diferente de 1 quando tivermos um…
-
1
votes1
answer1242
viewsA: Increasing the limit of "file Multiple"
The php.ini has a directive that limits the amount of simultaneous files in the upload. Try to change it: if(isset($_POST['logar'])) { $files = $_FILES['files']; $directory = 'uploads/'; //altera a…
-
2
votes2
answers1434
viewsA: PHP imagecopyresampled() function cutting in the wrong place
Observing the code in crop.php in the jCrop plugin examples, we have the code executed when the user gives a POST: $targ_w = $targ_h = 150; $jpeg_quality = 90; $src = 'demo_files/pool.jpg'; $img_r =…
-
2
votes4
answers180
viewsA: Remove array positions that have the common name
My contribution, mixing a little of the answers already given: $arr = array( 'id' => '147', 'nome' =>'João', 'email' => '[email protected]', 'data_nascimento' => '05/01/1987', 'numero_1'…
-
4
votes2
answers1970
viewsA: What is the relativity of the rem unit?
Citing W3C documentation on the unit rem: rem Unit Equal to the computed value of ːfont-size' on the root element. When specified on the ːfont-size' Property of the root element, the ːrem' Units…
-
6
votes1
answer2499
viewsA: How do you always get the last video from a Youtube channel?
Because the data is ordered by decreasing date, the easiest way to get the last video without having to change the code structure is to manipulate the parameter max-results URL: Of:…
-
0
votes2
answers290
viewsA: Changing a textbox within a textbox group / jQuery
$(".vlr_total").val(calcula($(".vlr_unit").val(), $(".quantidade").val())); tells jQuery to take the first element that contains the class .vlr_total and change its value. Already to change the…
-
3
votes3
answers480
views -
4
votes1
answer1379
viewsA: Select a Mysql table inside a PHP file without refresh
You should use Javascript (AJAX) to display the data without having to reload the main page. I suggest using the jQuery library to facilitate interaction of AJAX requests. 1) Separate the file…