Posts by rbz • 9,949 points
356 posts
-
0
votes1
answer22
viewsA: Spinner error to popular by Sqlite
Solved ! The mistake was on the line: clientes.add(cursor.getString(cursor.getColumnIndex("_id"))); Altered: clientes.add(cursor.getString(cursor.getColumnIndex("nome"))); I’ll leave the topic for…
-
0
votes1
answer22
viewsQ: Spinner error to popular by Sqlite
Error: Caused by: java.lang.Illegalstateexception: Couldn’t read Row 0, col -1 from Cursorwindow. Make sure the Cursor is initialized correctly before accessing data from it. Classes Novoregistro:…
-
1
votes1
answer81
viewsQ: Reference main class variable, in a @Override
We can reference a variable of the main class, for example within the method onCreate of the two forms (with or without the this): public class NovoRegistro extends AppCompatActivity { TextView…
-
0
votes1
answer265
viewsA: Compare two totals using LEFT JOIN in Mysql
When there are 2 tables (1 for many), you have to start from the table that has more related records, group them and reference with the single record table. Select: SELECT Id_Chave, TotalVenda,…
-
0
votes1
answer32
viewsA: Back in data txt
Example Do the query in the database, and have it printed with this function: function gravar($texto){ //Variável arquivo armazena o nome e extensão do arquivo. $arquivo = "nomedoarquivo.txt";…
-
0
votes3
answers2980
viewsQ: AJAX Return Handling with JQUERY
I have the following script, which processes the form and updates the div #list by ajax: <script type="text/javascript"> $(document).ready(function(){ $("#formulario").on("submit",…
-
1
votes2
answers3825
viewsA: Admob No ads appear
only when running the ad area it turns white Test directly on the device or to test with emulators, you can try this way: AdRequest adRequest = new…
-
0
votes1
answer68
viewsA: Query "escape" handling (character escape)
Solved with the command addslashes: public function forward($descricao){ $descricao = addslashes($descricao); ($descricao == '') ? $descricao = 'NULL' : $descricao = "'{$descricao}'"; $sql_enc = "…
-
0
votes1
answer68
viewsQ: Query "escape" handling (character escape)
Setting: Query of insertion: public function forward($descricao) { ($descricao == '') ? $descricao = 'NULL' : $descricao = "'{$descricao}'" ; $sql_enc = " INSERT INTO rg_encaminhamentos…
-
2
votes1
answer372
viewsA: Syntax error when using Sqlite android "DROP TABLE IF EXISTS"
When you put: db.execSQL("DROP TABLE IF EXISTS" + TABELA) Its result would be: DROP TABLE IF EXISTSTABELA So to correct, give a "space" after the EXISTS, because it is a String: db.execSQL("DROP…
-
0
votes1
answer39
viewsQ: Value is not being taken via POST
In the index.php has 1 field input that sends a value per ajax, which must be read by cdb.php. index php.: <script type="text/javascript"> $(document).ready(function(){…
-
1
votes2
answers719
viewsA: Bring repeat records from 3 columns in the same table
UNION: to bring the three together. GROUP BY: to unite the equal results. SELECT * FROM ( SELECT valor1 valor FROM TABELA UNION SELECT valor2 valor FROM TABELA UNION SELECT valor3 valor FROM TABELA)…
-
2
votes2
answers821
viewsQ: Sessions of different systems on the same server
Scenario (example) I have 2 systems: Sistema Padaria Posto System Details The database is separated, then each system with its users and passwords. There’s "common user" among the 2 (e.g.:…
-
0
votes2
answers675
viewsA: Position the text in the center
The property will be the layout_gravity, but it will depend on the type of layout which you are using, or will even use directly in the element, e.g. a textView, so it should also be aligned to your…
-
2
votes2
answers681
viewsQ: Error in String to Double conversion
Setting: public void metodoX(Double valor) { DecimalFormat df = new DecimalFormat("0.00"); String valorRound = df.format(valor); Double valorRound2 = Double.parseDouble(valorRound); ... } Error:…
-
0
votes1
answer260
viewsQ: Debug app emulating on mobile
I’m having a problem with a conversion string para double, in that in the emulador o APP está funcionando perfectly, but no celular ele trava and closes. I’d like to know how to debugar se quando…
-
1
votes2
answers68
viewsA: database saving only password
Your problem is in the form that brings the data via POST. You didn’t tag it name="username" in its input: Current: <input id="username" type="text" placeholder="Username" required autofocus>…
-
3
votes1
answer139
viewsA: Android Studio: Invisible problem?
You made a mistake here: textResultadoA = (TextView)findViewById(R.id.textResultadoA); textResultadoA = (TextView)findViewById(R.id.textResultadoB); textResultadoFinal =…
-
5
votes4
answers15459
viewsA: What is the difference between LIKE, IN and BETWEEN in Mysql?
Examples in the rray response: LIKE: is used to do partial searches in text type fields (varhcar text etc) using wildcards % _. SELECT * FROM tabela WHERE campo LIKE 'abc' SELECT * FROM tabela WHERE…
-
0
votes2
answers566
viewsA: Passing information to another Activity
Error Your mistake is creating a new bundle and not pass it to activy, or could use the bundle of onCreate. How to do There are 2 ways: Sem o Bundle (because his intent already has one on onCreate)…
-
6
votes1
answer3429
viewsQ: Use Bundle and/or only putExtra?
To pass data between activity, have 2 forms: 1. Using Bundle: public void teste(View v) { Intent i = new Intent(this,Teste.class); Bundle bd = new Bundle(); bd.putString("site","google.com");…
-
3
votes2
answers8186
viewsA: Mysql using variables in select
If you wanted a predefined variable, use the SET: -- seta o valor da variável SET @idPedido = 10; -- imprime o valor SELECT @idPedido; --neste caso, o retorno será 10 Using a query to search and set…
-
1
votes1
answer200
viewsA: Error executing mysqli_query() in BD Select
You need to connect to mysqli_query: $query = mysqli_query($conn,"INSERT INTO nivel_acessos (nome_nivel, created) VALUES ('$nome_nivel', NOW())"); Syntax: mysqli_query($conn,"query");…
-
1
votes2
answers427
viewsA: Doubt simple back web view
Has the onKeyDown Class MainActivity: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
2
votes2
answers109
viewsA: Search filter that does not filter
Whereas you are receiving these form variables: $servico = $_POST['servico']; $estado = $_POST['estado']; $cidade = $_POST['cidade']; Put it like this on this line: $sql = "SELECT * FROM teste WHERE…
-
0
votes2
answers41
viewsA: Login form returning error!
Apparently, we’re missing the SELECT campos before the FROM olmp_cadparaprova WHERE email = 'cirillosales9' Ex.: SELECT campo FROM olmp_cadparaprova WHERE email = 'cirillosales9' SELECT * FROM…
-
1
votes1
answer768
viewsA: SQL Delete with Join, Union in Firebird
You have to use the EXISTS. Check in the official manual: Firebird DELETE DELETE FROM employee e WHERE NOT EXISTS( SELECT * FROM employee_project ep WHERE e.emp_no = ep.emp_no);…
-
0
votes1
answer89
viewsA: android studio misalignment login form
Reindeer the RelativeLayout is a bit boring even, you need to create "anchors" (reference between the elements)(alinhamento entre os elementos). Usually most people use the Linear Layout, with more…
-
3
votes2
answers1290
viewsA: How to check Null in a select @Local_variable
You can use CASE: DECLARE @Minha_Var VARCHAR(70); SELECT @Minha_Var = NOME FROM CLIENTES WHERE ID = 10 SELECT (CASE @Minha_Var WHEN NULL THEN '1' ELSE '2' END) NOME Você pode trazer diversos…
-
0
votes1
answer67
viewsA: Relationship in tables in the database
Yes, better relate tables by agilidade and mainly economia de espaço. For example: All registro of a car "black" you will have 5 caracteres correct ? If you have a tabela relacionada, would only be…
-
1
votes1
answer1069
views -
0
votes2
answers56
viewsQ: Element update with Jquery with return from another script
I have a formulário de e-mail simples, and when you click "Send" the "status" appears next to the button, for example: Enquanto envia, appears "Sending..." (this is already working) The problema is…
-
1
votes2
answers2682
viewsA: How to set up XAMPP for Sql Server 2014
Flavio, you can download the drivers do SQL Server (https://www.microsoft.com/en-us/download/details.aspx?id=20098) or use the PDO. Put the files in c:\xampp\php\ext In the php.ini define extensions…
-
0
votes1
answer77
viewsA: How do select in Mysql to get this result
First that has no unanswered question, then includes one for the test: INSERT INTO `pergunta` (`id_pergunta`, `titulo`, `status`) VALUES ('5', 'O que achou da sua Pergunta ?', '1'), ('6', 'O que…
-
0
votes4
answers687
viewsA: Add all values that are in the database and show on screen
The select is this: SELECT SUM(valor) FROM anuncios How you’re gonna handle it and display it, then there’s no telling with that piece of code. If you want, whole pole.…
-
1
votes1
answer55
viewsA: Two tables returning only one result
Charles, I can’t simulate it here, but the concept (SQL) is this: SELECT CL.codcliente, CL.dt_cadastro, NF.numnf, MIN(NF.dt_emissao), NF.totalnf FROM nfsaidc NF LEFT OUTER JOIN cliente CL ON…
-
4
votes1
answer1113
viewsA: Difference between INNER JOIN, JOIN and WHERE?
Cara has a lot of material on this, but this image I sent as a comment will help you better. Basically you have to understand the concept of left and right (left e right), for example: Your table in…
-
1
votes1
answer128
viewsA: Doubt in sql exercise query
Try this way: SELECT PF.nome, DI.nome, AVG(AL.nota) as Media FROM Aluno AL LEFT OUTER JOIN Professor PF ON PF.NumFunc = AL.NumFunc LEFT OUTER JOIN Disciplina DI ON DI.NumDisp = AL.NumDisp LEFT OUTER…
-
0
votes1
answer296
viewsQ: Text break by delimiter
I have the following text:: Texto|Texto|Texto| I want to display it in a Textview, but every "|" (pipe) it breaks the line. In this way: String texto = this.textoQuebrado; String[] array =…
-
1
votes1
answer181
viewsA: What is it, Xamarin?
Exactly, you program in C# and it "converts" into an Android and iOS App. It has its advantages, one of them for not knowing 2 languages (java or Kotlin for Android and Swift for iOS) and create an…
-
0
votes1
answer60
viewsQ: Options menu with setOnItemClickListener
I have a listview, and with setOnItemClickListener and/or setOnItemLongClickListener do the deletion from the record. I’d like to know how to open a janela (like a modal, which opens the window and…
-
0
votes3
answers87
viewsA: I cannot pass Methods as Parameter in PHP
The correct is to use the "variável" in class and not only in methods. Example: <?php class DatesController { private $year; //Função que calcula o inicio e o fim da semana a partir do dia //...…
-
0
votes3
answers404
viewsA: SQL query does not return value
Avoid using the msql as the friend said, is obsolete. Try this way $sql = mysql_query("SELECT * FROM users ORDER BY idS DESC") or die(mysql_error()); while($row = mysql_fetch_array($sql)){ $i[] =…
-
2
votes4
answers2886
viewsA: Convert HTML to PNG
Has a library JS for that too: http://html2canvas.hertzen.com/examples.html
-
0
votes1
answer43
viewsA: Strange characters in page view
Open your HTML file on NOTEPAD++, go in Formatar -> Converter para UTF-8 (sem BOM). This will remove any GOOD character. I say use NOTEPAD++, because once was the only one that worked with me.…
-
1
votes2
answers471
viewsQ: Take programmatically generated Edittext values
I have an APP, which preencho a quantidade de jogadores that will have the championship and I click on a botão to create the championship. This button plays for a activity that takes the amount that…
-
0
votes2
answers320
viewsA: How to toggle table colors by grouping by a specific table field?
Based on what you’ve been through, I’ll pass on the concept of how I would: Like you said it could vary a lot, so basically you’d have to have a mapa de cores with regard to the right numbers !? For…
-
2
votes4
answers6957
viewsA: What is the difference between i++ and ++i?
I did it once at Solo Learn, and people liked the simplicity: <?php # Antes $a = 5; $b = $a++; echo "b = ".$b; // b = 5 echo "<hr>"; # Depois $x = 5; $y = ++$x; echo "y = ".$y; // y = 6…
-
1
votes4
answers1139
viewsA: How to get last login of each user using mysql?
ALL users with their latest successful and error logins: SELECT usuario, MAX(data) data, codigo FROM adm_historico_acesso WHERE codigo = 'erro' GROUP BY usuario, codigo UNION ALL SELECT usuario,…
-
0
votes1
answer63
viewsQ: APK protection against Disassembly and others
I would like to know how to protect the code of a APK Android, because if we extract, we have the templates, if we use certain programs, we have virtually all the classes. What Ways Do You Know To…