Posts by thiagobarradas • 1,262 points
29 posts
-
5
votes2
answers4944
viewsA: Put value on everything null in mysql
From what I understand you had something like this: TabelaX |--------------------| | ColA | ColB | ColC | |------|------|------| | 1 | 'ab' | 3 | | 2 | 'ac' | 3 | | 3 | 'ad' | 5 |…
mysqlanswered thiagobarradas 1,262 -
7
votes4
answers1991
viewsA: Difference between span img and div img
It depends on your goal. This is used to inherit the properties of the top element. Using <span> It’s like you want to apply style="display: inline". Using <div> It’s like you want to…
-
9
votes2
answers1326
viewsA: Know if user is connected PHP
You should store the time of the user’s last action/navigation and IP. So you could check with the time that your session remains alive and allow only the access of those who are logged in at that…
phpanswered thiagobarradas 1,262 -
0
votes2
answers51
viewsA: How to do two checks in select
Rewriting your code, the use switch is more advisable than the use of if..else, at any time you can replace your if for switch, o make. switch ($w_op) { case "P": $w_where = "where…
-
-2
votes3
answers2269
viewsA: What is the most efficient way to select items from a table?
Depends on what you want to look for. A specific line? a certain set of lines? all lines? Here is a brief explanation with suggestions for the study and evaluation of your case. When you filter a…
-
1
votes1
answer681
viewsA: Loop for adding Mysql fields
TB_DADOS (would be your Tabela1) | A1 | A2 | A3 | A4 | B1 | B2 | B3 | B4 | C1 | C2 | C3 | C4 | |----|----|----|----|----|----|----|----|----|----|----|----| | 5 | 1 | 8 | 2 | 9 | 2 | 16 | 1 | 1 | 11…
mysqlanswered thiagobarradas 1,262 -
2
votes2
answers1563
viewsA: Refresh a page after Submit PHP
In popup, enter in event onunload (that will be triggered when you have close the popup) for the parent page to be reloaded. <body onunload="window.opener.location.reload()">…
phpanswered thiagobarradas 1,262 -
3
votes1
answer1494
viewsA: Structure of a database for 'Secret Friend'
There are several modes and ways, depends on who is modeling the system. Let’s assume the group table: TB_GRUPO ID_GRUPO (identifier); NOME_GRUPO (name, hidden friend company Xyz); DATA_SORTEIO…
-
7
votes2
answers1017
viewsQ: Prevent DROP TABLE
I would like to prevent deletions on a table in Sqlite. CREATE TRIGGER nao_deletar_tabela BEFORE DELETE ON tabela BEGIN SELECT RAISE(IGNORE); END; It worked! Whenever one runs DELETE, nothing…
-
1
votes3
answers1338
viewsA: How to suspend the $_GET parameter if the array is empty?
Do not send: The correct would be to use javascript for not send to the server. However your server will anyway be waiting for a value, even if it is 'nothing' (null), and when sending null, no…
-
0
votes2
answers10928
viewsA: Command to create site shortcut on smartphone?
I’m sorry, but I don’t think the web. The options would be: The user using the smartphone features will do this manually You will have to create a native android app that just opens your site, will…
-
0
votes3
answers1873
viewsA: if condition with Javascript inside PHP
<script language=javascript> function isNullCustom(test) { return (test == null || test == "null" || typeof(test) == "undefined" || test == ""); } var string_patr = "<?php echo…
-
16
votes6
answers10591
viewsA: Differences between Parse() vs Tryparse()
The Parse spear a exception if he can’t convert the value, the Tryparse returns a bool indicating whether or not he succeeded. Example: int n = int.Parse(textBoxNumero.Text); For the above code,…
-
3
votes2
answers1254
viewsA: Side menu with fixed width and content 100%
In the width of .content use the value auto. width: auto; Click here to see your code changed in Codepen.io. Tip: The ideal would be in place of the tag header you use the tag Nav which has the real…
-
1
votes1
answer223
viewsA: Resize image and add white space to exact size
With CSS is possible: CSS: <!doctype html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <title>Exemplo pt.stackoverflow - Pergunta 10483</title>…
wordpressanswered thiagobarradas 1,262 -
4
votes4
answers9544
viewsA: How to display parts of a page only after loading the entire content of the site?
Using HTML, CSS and JS: <!doctype html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <title>Carregar parte após todo carregamento</title> <style> /*…
javascriptanswered thiagobarradas 1,262 -
1
votes3
answers1672
viewsA: Overwrite file snippet with php?
There are several ways... What you asked for, I believe is basically this: <?php // Tamanho padrão da sua linha $linha_tamanho_default = 20; // Array que define o inicio do valor na linha de…
phpanswered thiagobarradas 1,262 -
3
votes8
answers56968
viewsA: PHP echo Special character problem ("ç")
Among the tags <head></head> insert: For html 4.0/4.1 or xhtml 1.0: <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> For html 5: <meta charset="UTF-8" />…
-
1
votes6
answers11946
viewsA: Converting a string to int?
Converts and checks whether you were able to convert: string str = '0123'; // ou qualquer coisa int i = 0; // inicializa variável que receberá o valor inteiro // Tenta converter str para inteiro…
-
2
votes2
answers315
viewsA: Page page by Id
Changing the answer since the question has been reformulated. First, this variable ID does not exist. It would be a variable for the pagination control. Let’s call it PAGE and it is passed via GET.…
-
2
votes1
answer86
viewsA: Swap Table by topic
I don’t get it, but I’ll try. I think he’s trying to list and associate the results with the ID. Let’s try. <script type="text/javascript"> // função javascript que receberá id e redirecionará…
phpanswered thiagobarradas 1,262 -
1
votes5
answers7780
viewsA: How to use str_replace in single quotes without removing the ones that are required?
The problem is in your connection with the bank. Use PDO that your information will be stored exactly the way it went, without having to remove or replace special characters, quotes, etc. And when…
-
0
votes3
answers3345
viewsA: Div with height 100%
From what I understand you want something like this: If the page has little content, the footer remains attached to the browser footer. Click on Example. If the page has enough content, the footer…
-
1
votes4
answers1407
viewsA: Prioritize word in SQL query - Mssql
I don’t know if I get it and it would be the best way, but you could do something like that. I will illustrate the various ways I understood. I think what you meant was this, a query that matches…
-
4
votes2
answers13056
viewsA: Changing Mysql data in PHP
From what I understand you are wanting to reformulate this update form to make it work. Below is a way to do. In this example only one file is used Altering.php, where it identifies if the request…
-
0
votes4
answers3403
viewsA: Check data in the database according to the date
You don’t even need to use the variable $condicaoData, using the Mysql NOW() function to capture the current moment and the DATE_SUB() function to subtract a certain date range. See the example…
-
30
votes8
answers64831
viewsA: How to check if a checkbox is checked with PHP?
If your HTML page looks like this: <input type="checkbox" name="meucheckbox" value="umvalorqualquer"> When sent, if the check box is not checked, there is no variable meucheckbox, his value is…
phpanswered thiagobarradas 1,262 -
1
votes6
answers6055
viewsA: Part of the Label in Bold?
Alternative TO: Works well. John, Joseph and Mary lblTitulo.Text = 'João, <b>José</b> e Maria'; Alternative B: It’s not ideal, but you can do it using several Abels and this would give…
-
3
votes2
answers515
viewsA: php Show the variable
According to your select, the equivalent indices are: 0 equivalent to Name 1 equivalent to data1 2 equivalent to data2 3 equivalent to data3 4 equivalent to data4 Assuming the connection to the bank…