Posts by Pedro Henrique • 154 points
5 posts
-
2
votes1
answer48
viewsA: Insert users into different databases
In this case you use a transaction to ensure that the data will be entered in both banks. The insertion will be done once in each one. In Mysql it looks like this: BEGIN; INSERT INTO…
-
1
votes1
answer34
viewsA: Encapsulation of random amounts - is it possible?
To return the PHP data you can use the function echo. It will return what is passed as parameter. $q = "SELECT * FROM `table`"; $r = $conn->query($q); $resposta =''; while ($row =…
-
0
votes4
answers39
viewsA: Knowing which index of array values gives "match" with variable
You can use the function indexOf(). In your case it would look like this: var array1 = ["Amarelo", "Amarelo", "Amarelo", "Preto", "Preto", "Preto"]; var variavel1 = "Amarelo"; var index1 =…
-
2
votes1
answer223
viewsA: Generate JSON from a URL and Search by location
You need to start calling the URL via ajax, var userData = URL: "http://url.com/arquivo.json" }; will not work, with jQuery gets like this: var userData = ''; $.ajax({ url:…
-
-2
votes2
answers4615
viewsA: SQL LIKE is Case Sensitive(Case Sensitive)?
In Mysql the LIKE operator is case-insensitive by default, whether you are looking for Joe, Joe, Zoe or ZÉ. In the case of comparing the accent of Luis and Luis you can simply make use of an OR, for…