Posts by Oliveira • 1,912 points
46 posts
-
1
votes2
answers139
views -
2
votes1
answer146
viewsA: Passing values from a Select Multiple to the bank (Codeigniter)
A possibility would be the following within your controller/model: $array['categorias'] = $this->input->post('categorias'); foreach ($array['categorias'] as $value) { echo $value; }…
-
3
votes1
answer53
viewsA: Resize image with PHP before uploading to the image server
Utilize $_FILES['arquivo']['size'] to check the size of the image directly in the code, in case you need to use the file upload settings in the php.ini, the value returned is in bytes, of the file…
-
2
votes2
answers243
viewsA: Problem with accents and special characters, called Ajax
One possibility is to remove the encodeURIComponent, I believe that you will not need to use the encodeURIComponent in your scenario, because AJAX is using the method POST, its method was GET it…
-
7
votes1
answer414
viewsA: How to filter JSON data using PHP?
In your scenario when using $arrData = json_decode($jsonData); is converted the json into an object and you tried to go through that object in a wrong way, note that the data is in attributes of…
-
7
votes3
answers680
views -
2
votes2
answers35
viewsA: Pass Form + Variable by AJAX
One possibility is to use the method SerializeArray var data = $("#form-fatura").serializeArray(); data.push({name: "off", value: offset});
-
4
votes1
answer100
viewsA: count different values and group at the same time
One possibility is to use count, distinct and group by This query presents the number of neighborhoods per city and neighborhood. SELECT city, neighborhood, count(neighborhood) as qtd_bairros FROM…
-
4
votes3
answers814
viewsA: SELECT WITH STRING FORMATTING
If you don’t need to work with DATA, only for formatting and presentation from sql you can use the function CONCAT and SUBSTR. The function CONCAT concatenates one or more parameters and the SUBSTR…
-
2
votes1
answer128
viewsA: How to use to_number in Postgresql with number in Brazilian format
The D the format '9999999D99' represents the decimal point and this is based on the locale of your database. Postgresql uses the dot as decimal separator due to American standard. One possibility…
postgresqlanswered Oliveira 1,912 -
2
votes2
answers415
views -
3
votes1
answer91
viewsA: SQL query where the last 2 digits of WHERE should be ignored
A possibility that you can use and use aq LEFT function, stating how many characters you use from the left, it is interesting to consider whether the data size will be the same for all records.…
-
3
votes2
answers36
viewsA: Pick up the value opened
The query below may be a possibility to return what you need. SELECT abertoCaixa FROM tblCaixa WHERE idCaixa = (SELECT MAX(idCaixa) FROM tblCaixa);
-
1
votes2
answers101
viewsA: How to use more than one LIKE in PDO bindValue
This is not the most appropriate possibility, but I believe it could make it possible to carry out the consultation. As described in the rray comment, bindValue may not accept sql chunk, so you…
-
3
votes3
answers948
viewsA: Limit maximum number of lines in a textarea
One possibility is not to allow line breaking using jquery. <script> $(document).ready(function() { $("#txtValue").keypress(function(e){ if (e.keyCode == 13) { e.preventDefault(); } }); });…
-
3
votes2
answers42
viewsA: How to place multiple ordered outputs in a table
A possible view #include <stdio.h> int main() { int tab, mult, result; printf("Tabuada de 1 a 9.\n"); tab = 1; for (tab = 1; tab <= 9; tab++) { mult = 0; while (mult <= 9 && tab…
-
3
votes1
answer100
viewsA: Error in GROUP_CONCAT Access function
Access does not support the function GROUP_CONCAT, one possibility is to use the functions First and Last SELECT e.idevento, e.titulo, e.descricao, e.obs, e.cupom, e.inicio, e.fim, First(p.nome)…
-
3
votes1
answer912
viewsA: How to send data from a form with attached file to an email with PHP and AJAX?
Change the passage $("form").serialize() and use the FormData to send file data. var data = new FormData($("form[name='contactform']")[0]);, also put the projects processData: false and contentType:…
-
3
votes1
answer69
viewsA: My download Function corrupting the file
A possibility and use the readfile, and change Content-Type to header('Content-Type: application/zip'); public function download($token, $renomear) { $local_file = 'download/' . $token . '.zip';…
-
1
votes1
answer77
viewsA: Doubt with if and elseif PHP
One possibility is to use the Class DateTime for date and time representation. (PHP 5 >= 5.2.0, PHP 7) <?php $data = '29/05/2019 18:22:50'; $data1 = DateTime::createFromFormat('d/m/Y H:i:s',…
-
2
votes2
answers282
viewsA: Comparing date and time in different fields
In the Sqlserver 2008 R2 a possibility would be the following: SELECT pessoa.nome, acesso.data, acesso.hora FROM acesso INNER JOIN pessoa ON acesso.id_pessoa = pessoa.id WHERE CAST(acesso_data AS…
-
3
votes1
answer76
viewsA: Extension . pdf does not download php
Check if the name of the boleto is correct, a possibility is the name of the boleto be without the extension PDF, no filename=$nomeBoleto, if the boleto name is empty, you will have no problem,…
-
2
votes1
answer66
viewsA: How to Group the results of a Select into two tables -- SQL
One possibility is to use the Inner Join clause: SELECT TBInfo.ip, HostName, NomePrograma FROM TBInfo INNER JOIN TBProgramas ON TBProgramas.ip = TBInfo.ip Another possibility is to group and…
-
3
votes1
answer57
viewsA: How to do a column search scan with counter bar character
One possibility is to use the function LOCATE from MYSQL, The function returns the position of the first occurrence of a substring in a string. If the substring is not found, this function returns…
-
0
votes2
answers571
viewsA: How to convert jpg images to webp using php?
Can also be used the Webp. In the CENTOS 6.10 it took the following steps: yum install gcc gcc-c++ kernel-devel yum install libjpeg-devel libpng-devel libtiff-devel libgif-devel Have the gcc, make…
-
0
votes2
answers103
viewsA: "Error" upon completion of CSV import
One possibility is to include if ($dados) continue; At the beginning of while. Notice PHP…
-
2
votes2
answers134
viewsA: I cannot send JSON array to PHP page
In this example, the POST method is used. HTML <div id="demo"> <button type="button" name="" value="" class="button" onclick="enviArray()">Teste</button> </div> JS <script…
-
3
votes4
answers553
viewsA: Get values from a multiple select (Materialize)
Use a generic Jquery iterator function ($.each), which can be used for iteration of objects and matrices. <script type="text/javascript"> $(document).ready(() => {…
-
2
votes2
answers206
viewsA: How to use GROUP_CONCAT in the WHERE clause, with numbers?
The subquery returns the records that have relationship between the table bois and bois_manejo by id and fk_bois respectively by INNER JOIN. In this scenario the records that are in oxen but are not…
-
2
votes2
answers935
viewsQ: How to Debug Classic ASP in Visual Code
Like debugging classic ASP in Visual Code, some specific extension may be suggested or another form of configuration so it is possible to debug.…
-
2
votes2
answers42
viewsA: Uncaught Syntax error when assigning Object values in Javascript
The problem is on the following line: var moto = {'Modelo - '+ modelo: fabricante}; put keys to resolve this incident: var modelo = 'Yamaha Fazer 250'; var fabricante = 'Yamaha'; var moto =…
javascriptanswered Oliveira 1,912 -
1
votes2
answers49
viewsA: Does not return data from PDO database table
Code suggestion: <?php $dsn = 'mysql:host=localhost;dbname=dbphp7'; $user = 'root'; $password = ''; try{ $conn = new PDO($dsn, $user, $password); } catch(PDOException $ex){ echo 'Connection…
-
1
votes2
answers37
views -
4
votes3
answers2090
viewsQ: How to add Count output from different tables in SQL Server?
How to add up the result of Count of different tables in SQL Server? Example: Table WORKS has 755614 Records SELECT count(*) from OBRAS; Table TITLES has 85106 Records SELECT count(*) from TITULOS;…
-
0
votes1
answer131
viewsA: mysql PHP problem when using trema
Have you checked the excerpt below the comment *//Checa Especial* $sqlTremas = mysqli_query($conn, "SELECT id, nome FROM clientes WHERE nome LIKE '%ö%' OR nome LIKE '%ä%' OR nome LIKE '%ü%'"); while…
-
4
votes1
answer61
viewsA: Doubt - SQL Server 2012 Query
A possible way, if the comparison were the current date, could use the following: SELECT tarefaid, dataabertura, datavencimento FROM Tarefa t LEFT JOIN Usuario ur ON ur.UsuID = t.UsuIDResponsavel…
-
2
votes1
answer673
viewsQ: How to perform line breaking of a String within a cell in Excel with VB.NET?
How can I perform line breaking of a String with multiple cities concatenated to each state listed in an Excel cell exported in VB.NET and using Officeopenxml and Officeopenxml.Drawing. Excerpt from…
-
5
votes2
answers8717
viewsQ: How to restrict the filling of only numbers in an input with Angularjs?
I noticed that the page has the following code for an input: <div class="form-group required col-md-3"> <label for="area" class="control-label">ÁREA(ha):</label> <input…
-
3
votes1
answer812
viewsQ: Comparison between two Python objects using id() function with different result
Researching, I noticed that the function id() returns an integer and that guarantees to be unique and constant to the object. When comparing two objects I got different results, which may have…
-
8
votes2
answers4529
viewsQ: What is the concept of Stubs and Drivers in integration tests?
What is the concept of driver and stubs in integration tests, what is the difference between them? In what situations should be used?
-
4
votes3
answers1181
viewsA: How to check if type="file" field has been filled
Check if the attribute is included in the form: enctype and with the value multipart/form-data. This value is required when you are using forms that have a file upload control. The enctype attribute…
-
3
votes2
answers3541
viewsA: What command returns the tables that are in LOCK in Postgresql?
SELECT l.locktype, t.relname, l.page, l.virtualtransaction, l.pid, l.mode, l.granted FROM pg_locks l, pg_stat_all_tables t WHERE l.relation = t.relid AND t.relname NOT IN ('pg_class', 'pg_index',…
postgresqlanswered Oliveira 1,912 -
2
votes2
answers1010
viewsA: Does the use of traits replace the role of multiple inheritance?
Suppose you have two or more classes that need to use a common method, it may be possible to use Traits. Traits are mechanisms that help in code reuse, and serve perfectly to solve the problem of…
-
1
votes6
answers9622
viewsA: Transform json array into php array
If in the json_decode function the true parameter is passed, json_decode returns an associative array. $lista = file_get_contents("http://mcapi.ca/query/ip.craftlite.com.br:25571/list"); $infor =…
-
5
votes2
answers3541
viewsQ: What command returns the tables that are in LOCK in Postgresql?
What command can I execute to return the tables that are in LOCK in the PostgreSQL. Example query of lock: BEGIN; LOCK TABLE documento_sequencial ... COMMIT;…
postgresqlasked Oliveira 1,912 -
5
votes2
answers615
viewsA: How to decode the following JSON? PHP
$json = '{ "data": { "app_id": "0000000", "scopes": [ "public_profile" ], "user_id": "00000000" } }'; //json_decode retornando um objeto $object = json_decode($json); $user_id =…