All Questions

4
answers

Foreign key can become primary key?

For example, I have two tables: client and contact. The Contact table contains the customer's phone column as the primary key, fax column, and email column. The client table contains the customer's phone column as the primary key and foreign...
asked on 07.03.2014 / 05:11
3
answers

Clear Zip with JavaScript

How to clear the formatting of a ZIP code field in this format: 87.678-000 ? I need to remove the "." and the "-" and return only the numbers. I tried something like that, unfortunately it did not work out. var i = '^[0-9]+$'; var reg...
asked on 23.05.2014 / 18:47
3
answers

How to get only the second class with Jquery?

<td> <input type="radio" value="5" name="Form1a1" class="abobrinha Form1comentarioA" /> </td> I have 2 classes inside in my input radio, in jQuery I would like to select only the last class (which in my case is the second...
asked on 15.07.2015 / 20:41
4
answers

How to replace {vars} in a string?

I have a string string str = "Bem vindo {Usuario}. Agora são: {Horas}"; I want to replace {Usuario} with a name and {Horas} with the current time, how can I do this?     
asked on 19.12.2013 / 03:16
2
answers

Remove empty positions from an array

I'm passing array via GET to PHP and then sending to the client side (JavaScript). When I get it it looks like this: m_prod = [5,,,,,,,,6,,,,,,]; In other words, it is including a space in the positions that do not contain a v...
asked on 19.11.2014 / 15:47
2
answers

How to shorten the process of creating an array without the need to write all indexes?

For example, if I need to create an array with 20 spaces, do I always have to do this? $teste = array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19); Or is there any way to shorten this process, from 0 to 19? Something like: $teste =...
asked on 30.06.2017 / 19:38
2
answers

How to get column names from a table in SQL Server?

Languages table: HowdoIselecttheColumnNamesofthistable?Theresultwouldbe:"IDIdioma", "Sigla" and "IDioma".     
asked on 02.03.2017 / 14:20
5
answers

Strange behavior in a possible way of commenting

I have two functions /########### CARREGAR - LANÇAMENTO ###########/ var carregar_parametros=function(){ alert('asd'); } /########### CADASTRAR - LANÇAMENTO ###########/ var cadastrar_parametro=function(){ if($("#lancamento").val()!=''...
asked on 21.05.2014 / 14:55
3
answers

How to make a foreach for an array of arrays?

How can I make a foreach for an array of arrays like this: array ( [option1] => 2 [option2] => array ( [name] => "ola mundo" [id] => "123456"...
asked on 03.10.2014 / 16:55
3
answers

How to delete folders, subfolders and files?

Using my example below, I can delete a folder and the files it contains: $uploaddir = "../img/uploads/".$destino_sa."/"; $dir_contents = scandir($uploaddir); if(is_dir($uploaddir)) { foreach($dir_contents as $content) { unlink($upl...
asked on 08.05.2014 / 04:14