Posts by abfurlan • 10,570 points
221 posts
-
3
votes1
answer1857
viewsA: How to compare Date to Mysql field
You can do this in the SQL query itself, example: SELECT * FROM consulta t WHERE t.dtconsulta >= curdate(); See here a minimalist example…
-
3
votes2
answers435
viewsA: Using BREAK within a while
Yes, it is good practice to avoid unnecessary iterations, an option if you do not want to use break for legibility reasons, would use an auxiliary variable to test the loop, example: $valido = true;…
-
2
votes2
answers792
viewsA: Position controls with bootstrap not aligning
The problem seems to be in the attribute class of his input, where class="form-control;col-sm-2" Change to class="form-control col-sm-2" <form role="form"><!--A tag ul contem os titulos das…
-
6
votes3
answers540
viewsA: Link resources, such as CSS, within the structure of a website
One way would be using the tag groundwork to set the default url <head> <base href="http://meu-dominio/"> <link rel="stylesheet" type="text/css" href="style/cabecalho.css">…
-
1
votes2
answers327
viewsA: PHP and Mysqli. Table link problem
The connection syntax is: $mysqli = new mysqli("meu_host", "meu_usuário", "minha_senha", "meu_banco"); So in your case, the error is stating that there is no table people in the database app, make…
-
2
votes3
answers1666
viewsA: How to view a dropdown menu of a button inside a div with overflow: Hidden?
I don’t know the whole structure of your page, but follow a suggestion using position:fixed to the menu-dropdown: ul.dropdown-menu{ position: fixed; top: 10px; left: 20px; overflow: visible; }…
-
3
votes2
answers176
viewsA: How important is it to use friendly URL?
Some points that I consider important and relevant to the use of friendly url Raking on search sites Search engines handle dynamic url (my-page.php? post=1234) other than static url…
-
3
votes1
answer723
viewsA: How to center figure with max-width set?
You need to add margin 0 auto; on your tag figure #img-home { margin:0 auto; background: #eed46f; padding: 5px; max-width: 330px; text-align: center; } Example: Jsfiddle…
-
5
votes1
answer58
viewsA: multi column adjust content
You need to add property break-Inside to determine column breakage: -webkit-column-break-inside: avoid; -moz-column-break-inside:avoid; -moz-page-break-inside:avoid; page-break-inside: avoid;…
-
7
votes3
answers3508
viewsA: How to make a site multilingual?
The forms cited are valid and functional, but I see a problem in using constant and arrays to this end, you may forget to set any of these for a particular language and will have problems. A…
-
9
votes3
answers16157
viewsA: Automatically load content when you reach the bottom of the page
The technique you seek is called content on demand or infinite scroll. Say you have in your code a div that carries its contents <div id="conteudo"> <p>Lorem Ipsum</p>…
-
1
votes1
answer765
viewsA: Upload multiple files with Node.js
To upload multiple files the attribute name of input should be followed by [], so the files will be sent as array <form method="post" action="" enctype="multipart/form-data"> <input…
-
11
votes1
answer5827
viewsA: Mounting map style site bomnegocio.com
Creating an interactive SVG map is simple but laborious. First we must create the SVG file, It is necessary to create the states separately, for this I will demonstrate using the image editor GIMP:…
-
6
votes4
answers3597
viewsA: json returns null with special characters
Use the constant ENT_QUOTES to convert the quotes: $string = htmlentities('Av. 7 de setembro – Salvador', ENT_QUOTES, "UTF-8"); // String com o caracter que retorna erro $string2 = htmlentities('Av.…
-
1
votes3
answers104
viewsA: I need to list a text field with values separated by ;
There are several ways to do, one option would be to make a explode() and then implode(), example: $str = '11 2222-3333;12 9 1111-2222;18 1111-2222;11 2222-3333'; echo…
-
2
votes2
answers2655
viewsA: Dependencies in the same table
You can create a relationship in your table, see in the example below: In this case, for holders you leave the field id_titular as null. To select holders and dependents: SELECT a.nome as titular,…
-
4
votes2
answers2553
viewsA: How to get database information without updating the page
You will need ajax for this, follow a minimalist example: $.ajax({ url:'minha_pagina_acesso_banco.php', //sua página em php que retornará os dados type:'POST', // método post, GET ... data:…
-
2
votes1
answer2257
viewsA: Limit upload size with PHP
When an uploaded file exceeds the value set in post_max_size, PHP does not fire error, it simply sends a $_POST empty, there is a way to detect if the file exceeds the value set in post_max_size.…
-
3
votes3
answers54929
viewsA: Create HTML table and display data using PHP
Your code has several syntax errors, follow an example of code commented, for you to use as a basis to create your table. <?php //crie uma variável para receber o código da tabela $tabela =…
-
11
votes2
answers28085
viewsA: What are schemas? What are the advantages of using it?
What are Schemas? It is a container that can contain multiple objects. They are used to manage and organize the database objects. You can logically separate procedures, views, triggers, sequences…
-
4
votes1
answer5102
viewsA: Relate two mysql tables to data from the same column?
You need to do JOIN again with the table times, example: SELECT t.nome as time1, t2.nome as time2 FROM times t INNER JOIN jogos j ON t.id = j.time1_id INNER JOIN times t2 ON t2.id = j.time2_id…
-
22
votes3
answers1321
viewsA: Why is it not recommended to use "_" (underscore) in HTML/CSS?
To complement @Beet’s reply, I’ll leave a opinion, on the subject: In addition to the official CSS specifications Dashes (strokes), I believe that Dashes is recommended also for code convention…
-
47
votes3
answers12057
viewsQ: Differences between localStorage Vs sessionStorage?
What are the differences, pros and cons between localStorage and sessionStorage?
-
24
votes2
answers29269
viewsA: Why green = blue + yellow, but RGB yellow = green and red?
Basically because they are different color systems, additive (RGB) and subtractive (CMYK). Additive colors Used in monitors, it is generated by mixing various compliments of light waves. In the…
-
5
votes1
answer74
viewsA: List-style disappearing when using 'Columns'
You need to add list-style-position, to specify that markers should appear within the content stream: .menu{ -webkit-column-count: 2; -moz-column-count: 2; column-count: 2; list-style-position:…
-
1
votes5
answers1182
viewsA: HTML element does not become visible
I noticed that in your code you are validating all fields input,select ..., there is a problem in this, if there were no mandatory fields, this will bring you problems, if you intend to create your…
-
2
votes1
answer98
viewsA: Vertical wrap instead of horizontal
You can use the property column-Count to define the amount of columns of your container, example: <div class='wrap'> <div class='col'>div1</div> <div…
-
3
votes2
answers3776
viewsA: How do you make an element invisible when the value is 0?
Unfortunately using only CSS cannot select an element by its text. An option would be to place an attribute in this element to differentiate it, example: In his element span, place an attribute, for…
-
2
votes1
answer67
viewsA: Problems with Eventhandler . click() and . Animate()
In his <li id="nervID"> there is a link <a href="" ><p class="navp">Nerv</p></a>, when you put the function to onclick does not work, because by clicking, it is assumed…
-
2
votes4
answers4583
viewsA: Check for image return via Javascript
You can make a load image url to check if there is: function checkImagem(url) { var img = '<img src="'+ url +'" />'; $(img).load(function() { $('body').append(url+img); }).bind('error',…
-
2
votes1
answer1069
viewsA: Send by php mail function data from a table
What’s happening is that you’re creating the variable again $hmtl each iteration of loop, you need to concatenate the records, try so. $buscando = mysql_query("SELECT * FROM guardapedidos WHERE…
-
2
votes1
answer1308
viewsA: How to show complete post by clicking read all button?
I don’t know the structure of your project, but I’ll try to explain. You have a page where displays all the posts, on this page, in the title of each post as in your code, you added a link that can…
-
4
votes2
answers782
viewsA: Javascript and Asp.net mvc help
If you want to color the input Depending on the status when loading the page, you can make a jquery selector for this. In his input, you are using id="Status", This is invalid, we cannot have…
-
4
votes2
answers210
viewsA: I’m having a hard time understanding the logic
You can create N elements, but as not specified, I will leave in example with the element font: function fontes(frase){ for(var i = 1; i <= 7; i++){ // laço para criar os elementos var e =…
javascriptanswered abfurlan 10,570 -
5
votes3
answers529
viewsA: How to replace the last appearance of a character?
You can do: var str = 'Mussarela, Calabresa, Cebola'; str = str.replace(/,([^,]*)$/,' e'+'$1'); console.log(str);
-
2
votes2
answers474
viewsA: Mount query for database query according to checks marked
An option would also be you do WHERE column IN, example: $checkboxes = array('Basico','Intermediario'); $whereClause = "'".implode("','", $checkboxes)."'"; $query = "SELECT * FROM cursos WHERE…
-
2
votes1
answer83
viewsA: Toggle Animate() in Divs in the same position
You need to add one stop(), before the animate(), example: $(this).stop().animate({ top: "-200px" }, 500); When stop() is called in an element, the current animation is immediately stopped. If more…
-
-1
votes3
answers3942
viewsA: Scroll on page adds "ACTIVE" class to menu
You need to detect the click on your menu and add a class in case active, as quoted, example: $('#meuMenu ul li').click(function(){ $('#meuMenu ul li').removeClass('active');…
-
9
votes3
answers1415
viewsA: When should I use elements '<ul>'?
When we decide which component to use, we should think beyond the presentation itself, because aesthetically it would not make a difference to a user if we are using div or ul, but we need to think…
-
15
votes2
answers22549
viewsA: How to include Bootstrap Glyphicon inside the "<input></input>" tag?
Buttons of the type input, do not allow code html, for this use: <button type="submit" class="btn btn-primary" value="Salvar"> <span class="glyphicon glyphicon-floppy-disk"></span>…
-
0
votes2
answers4155
viewsA: Make item highlighted if it refers to the selected menu
If understood well, you can add a class to highlight the element clicked, example: CSS .active {background-color:red;} Jquery $('.produtosMenuItensLista').click(function(){ //remove class active…
-
4
votes3
answers146
viewsA: Handle single while record
You can do it just with CSS, using the property Nth-Child(), example: table tbody tr:nth-child(1) td{background-color:blue;} table tbody tr:nth-child(2) td{background-color:green;} table tbody…
-
4
votes3
answers1231
viewsA: Function that writes the first 50 numbers whose sum of the formant digits is 10
Although the answers already solve the problem, I will leave an option using only one loop and array reduce.(): var numeros = []; // para armazenar os números // sabemos que o primeiro número é 19,…
-
2
votes3
answers2200
viewsA: How to group mysql results by foreign keys in a single array through a single query?
Have you ever tried to make one JOIN, in the two tables, example: SELECT g.setor, r.ramal, g.gestor FROM tb_ramais r INNER JOIN tb_grupos g ON r.grupo_id = g.id SQL Fiddle Example The result of this…
-
2
votes2
answers182
viewsA: Layout error, scrolling left when there is line break
Place margin:0px in your class: #viewHours .btn-group>.btn { border-radius: 0; margin:0; } Jsfiddle…
-
2
votes5
answers5625
viewsA: URL friendly with . htaccess
I don’t know you understood well how friendly url works, so I’ll try to explain. The htaccess will not rewrite your url in the criacao-sites criacao_de_sites_e_lojas_virtuais.php for criacao-sites,…
-
6
votes4
answers6633
viewsA: What is the difference between pre and post increment in Javascript?
You will only notice difference when making use of the increment result, example: var i = 1; i++; console.log(i == 2); // true // é o mesmo que var i = 1; ++i; console.log(i == 2); // true //No…
javascriptanswered abfurlan 10,570 -
0
votes2
answers576
viewsA: How to get the last id inserted in Asp.net?
If you want to get the last id inserted directly into the database, you can do: INSERT INTO users (nome_us,...) VALUES ('Nome',...); SET @last_id_in_users = LAST_INSERT_ID(); INSERT INTO end_user…
-
3
votes1
answer60
viewsA: Is there any protection for the files generated with pg_dump?
Unfortunately there’s nothing native in the postgresql for such purpose, what you can do to "improve" the security of your files, is to use an external program to encrypt them, example: pg_dump -U…
-
3
votes5
answers7269
views