Posts by William Novak • 1,242 points
36 posts
-
1
votes1
answer40
viewsQ: Combine two or more types and tuples in Typescript
In the section below, I have the following types: // eg.: type ButtonTypeModifiers = 'is-primary' | 'is-secondary' type ButtonMarginModifiers = 'has-margin' | 'has-no-margin' |…
-
3
votes1
answer320
viewsA: UPDATE without changing the date of a record
Your table must have a column with the attribute: ON UPDATE CURRENT_TIMESTAMP Remove the attribute from the column and any update in your table will not change the date/time in the column.…
-
8
votes1
answer1057
viewsA: Convert any string to UTF-8 without knowing the original character set
Has a library available that plays this role without you having to be in doubt between which function of the PHP use to convert special character. That one library works only on the PHP >= 5.3…
phpanswered William Novak 1,242 -
3
votes1
answer232
viewsA: Codeingniter counting lines and displaying on View?
Model <?php class dashboard_model extends CI_Model { public function __construct() { parent::__construct(); } public function lista() { $query = $this->db->query('SELECT * FROM chamados');…
-
0
votes2
answers1776
viewsA: Ajax request url point to a route
Add an alias: Route::post('order/productsByCategory', ['as' => 'apelidoDaRota', 'uses'=>'OrderController@productsByCategory']); Call by alias: url: "{{ route("apelidoDaRota") }}",…
-
0
votes1
answer974
viewsQ: PG_DUMP via shell_exec returns "no password supplied"
I successfully execute the following command from the terminal: pg_dump -d teste -h 127.0.0.1 -p 5432 -U postgres -w -f /home/william/pgsql/17032701.backup However, when I execute the command by…
-
2
votes2
answers312
viewsA: Replace list() by placing value in each index of an array
The capacity of the function list goes far. There is the ability to handle arrays in more specific cases than your code will depend on. I consider that the list, can be used and abused, has the…
-
7
votes1
answer1709
viewsA: Div height 100% in div height auto?
See working here Jsfiddle. Basically, you force the display of the element wrap be a table (table) and that the divs are forced to be similar to the cells in a table (table-cell). #wrap { width:…
-
2
votes1
answer1416
viewsA: Pin menu to top of page when scrolling down
See working here Jsfiddle. Uses the function scroll, detects the event of scrolling the page, checks whether the size rolled down is higher the height of the navbar. If larger, add the class that…
-
1
votes1
answer572
viewsA: Set a session variable by clicking a link
Changing its structure a little bit to: <li class="dropdown"> <a style="color:white;"href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"…
-
5
votes1
answer824
viewsA: PHP - Forward $_POST to another domain
When you get the second POST, use the cURL to send the data you have via POST elsewhere. <?php # instancia $ch = curl_init(); # aqui você transforma seu POST # você pode fazer um tratamento das…
-
17
votes3
answers3547
viewsA: Meaning of parameters in an AJAX request
"async": false or true If it’s asynchronous or not. You may notice a difference in this attribute when working with answers on the screen or when you need to trigger a trigger at the very end of the…
-
0
votes1
answer95
viewsA: How to insert a file into an array
Normally includes the file in the array of configuration file. Routes.php return [ 'routes' => [ 'minhasRotas' => require "rotas.php", ] ]; Sets that your file will return one array. php…
-
1
votes1
answer299
viewsA: Remove last json item with jQuery
Using the function .pop() of javascript, and selecting which key should have the element deleted, you can. In this case, this way: HTML to test <input type="button" value="exclui ultimo do indice…
-
1
votes1
answer88
viewsA: Error downloading a site made in Codeigniter to my localhost machine
Since I didn’t say what the mistake is, just "", it’s hard to get it right. But come on, one time it works. If the site needs to connect to a banco de dados, you need to have this one created on…
-
0
votes3
answers85
viewsA: Ajax code is not working
Remove the onclick="myAjax();" of its element input, and start declaring events as follows: Rewriting your action button a little bit: <input type="button" id="um-teste" value="testar" /> Now…
-
1
votes2
answers623
viewsA: Last update Mysql table
Thus: SELECT UPDATE_TIME as ultima_atualizacao FROM information_schema.tables WHERE TABLE_NAME = 'nome_da_tabela' AND TABLE_SCHEMA = 'nome_do_banco';
-
0
votes1
answer539
viewsA: mysql error with foreign key
Problem with table names right. I know it’s confusing. Have table aluno, and the table professores creates tremendous confusion in the singular and plural. A hint: plural everything: professores,…
-
3
votes1
answer80
viewsA: Run php file with javascript
Why isn’t it working? On the stretch where you are using the load(url), I imagine you expect him to access url which provided and when the execution gets there you finish solving things. However,…
-
2
votes1
answer445
viewsQ: Group query by similar but non-identical records
I need to migrate a database (from SQL Server for PostgreSQL and I’m creating a ETL interactive in PHP to make this change), which is about 10 years old, about 2 million records in the clientes that…
-
2
votes1
answer743
viewsQ: Compare two strings and show difference between them
I accidentally clicked on a post It was edited here and I saw that Stackoverflow showed the differences of the edition. Soon, a lamp flashed over my head and now that I’m dealing with a CVT project,…
-
1
votes3
answers52
viewsA: Positioning of a thumbnail
Try: <style type="text/css"> .recent-posts .post-thumb { margin: 0; position: relative; height: 180px; overflow: hidden !important; vertical-align: top; /* talvez esse não se faça necessário…
-
2
votes1
answer208
viewsQ: Print array value in bash by PHP shell_exec
I have another script, but I simplified it for this to simulate the problem that persists. test sh. #!/bin/bash ARRAY=('like' 'a' 'stone') echo ${ARRAY[0]} In the file below, in another moment I…
-
0
votes2
answers3374
viewsA: Modify foreign key for auto-increment
Try: ALTER TABLE grupo MODIFY id_grupo INTEGER NOT NULL AUTO_INCREMENT;
-
1
votes1
answer477
viewsA: Laravel with Site + Cms + Intranet
Look at this vendor that allows working on Laravel with HMVC pingpong that might be more familiar to you. Anyway, even without using this vendor that I mentioned, your organization is worth when…
-
9
votes4
answers2583
viewsQ: Can PHP’s unset() function improve performance?
I think the answer to my question would be "yes." even because I end up doing it in my code (when I remember), but I just stopped to think about it now and I’m kind of worried if someone asked me…
-
0
votes1
answer1121
viewsA: Using filter_input_array(INPUT_POST,"var_name") vs. $_POST
I made a test simulating the code that posted and formulated the code below using the function: <?php $filtro = array( 'caption' => array( # aqui pode variar de acordo com o valor esperado do…
-
2
votes2
answers418
viewsA: how to get a correct sequence in order by mysql?
SELECT * FROM tabela ORDER BY CAST(coluna_numero AS unsigned) ASC
mysqlanswered William Novak 1,242 -
0
votes2
answers543
viewsA: how to compare hours and tell if the establishment is closed or open and return a Json message
<?php # dentro do seu while $statusRestaurante = 'fechado'; # guarda o timestamp da hora que abre $openTime = new DateTime($result['openRestaurante']); $openRestaurante =…
-
2
votes2
answers3404
viewsA: What systems approval techniques are available?
Look, I believe your question is for teaching purposes, and I wanted to apply all the knowledge that the faculty gave me to answer that question with pleasure. But honestly, I think it’s better to…
-
13
votes3
answers25273
viewsQ: Table and column nomenclature
For at least four years I’ve been working with the following table and column nomenclature which is exactly like this: The column name will always be tableName + column name =…
-
0
votes1
answer31
viewsA: Image with dynamic text to send by e-mail
I think this feature is exactly what you need: OCR in PHP: Read Text from Images with Tesseract…
-
3
votes2
answers2246
viewsA: Delete record from Modal Bootstrap window
$("a.delete").click(function(){ var $this = $(this); var id = $this.attr("id"); var data = 'id=' + id ; var $meu_alerta = $("#confirm-delete"); $meu_alerta.modal().find(".btn-ok").on("click",…
-
1
votes1
answer165
viewsA: Ajax sends php query in Mysql
The amount of inconsistencies in the code is large. In HTML there is no element whose id is product, you are using the tag getElementbyId to take an id that does not exist throughout the code, and…
-
1
votes1
answer56
viewsA: OG Facebook Goals: Doubt
Opá ! The meta tags were created to be used in the HTML header (header), as they and all header content are invisible to the end user. Inserting them into the body, in addition to not adding to…
-
1
votes1
answer86
viewsA: Problems in generating a table
<?php # valor que vem do formulario (se houver) $colaborador = 1; # todos os resultados por ordem de dia e hora (não importa a entrada e saída) de uma matricula (se for de todos, retire o WHERE)…