Posts by 8biT • 1,033 points
37 posts
-
1
votes2
answers177
viewsA: problem with PHP file path
Based on the project structure presented in the question image, you will have to go back 2 levels in your require. Note that if you go back only 1 level, it really won’t exist in your project…
-
3
votes1
answer40
viewsA: I have an echo for each number X of the Foreach Php
Missed only you to reset your counter inside your IF. $contador = 0 foreach ($Read->getResult() as $LastPDT): $contador ++; if($contador == 5): echo "conteudo"; $contador = 0; // Zerando contador…
-
5
votes5
answers304
viewsA: because my class only returns NULL
Well, as I mentioned in your question, it’s very strange the way you structured your classes. Referring to your question, you are giving a var_dumpin $a->getContato('$a->getContato('aaaaaaaa',…
-
0
votes2
answers43
viewsA: Refer to duplicate values in the same table
Taking into account your information (some superficial) I will assume a solution, I believe it is already necessary for your case. You can use the HAVING where you can use aggregate functions.…
-
7
votes3
answers162
viewsA: How do I validate an input as its content changes?
With the event onkeyup you can already do your validation. If you use the onkeydown validation will not be correct as your input will not have the current value pressed. Take an example:…
javascriptanswered 8biT 1,033 -
1
votes2
answers33
viewsA: Error Sitaxe PHP query in XML
You see, there are 2 points in your PHP code that are commented. ... foreach($xml->xpath(‘//livro‘) as $livro) { ... And ... $busca = $registro->xpath(‘//preco[.>55.00]‘); ... The error in…
-
0
votes3
answers112
viewsA: Prevent user from registering 3 times in the same week
As I had already commented on your question, if you make a count on your table agend_reservations will be right with you. In your case it would look like this: $datenow = date('Y-m-d');// Data atual…
-
1
votes2
answers51
viewsA: doubts in the elaboration of code
To return the message that was not found something can follow the @Pedro Augusto tip using the mysqli_num_rows. For the problem you have in the send button you could do a simple validation with an…
-
5
votes3
answers254
viewsA: How to concatenate a varchar into a Mysql function?
You can use the function CONCAT SELECT CONCAT(primeiro_nome, " ", ultimo_nome) AS Nome_Completo FROM CLIENTE There’s like configure Mysql to concatenate strings with the operator ||. But I’ve always…
-
6
votes2
answers630
viewsA: How to check if any text was selected before copying it?
With the events onmouseup and onkeyup you could create a function to check whether something was selected or not. Done this you can follow with your need (copy, change style, hide ...) See the…
-
2
votes1
answer59
viewsA: Error updating values fields with jquery;
@Bruno you are in the way, but there are some passages that are not correct. Your example: $(document).ready(function () { $('#frete').change(function(){ atualizaTotalLiquido(); });…
-
2
votes4
answers366
viewsA: Error with the return of a function to catch a century of a year
In your condition you’re putting || instead of &&. Think about it, if the user "submit" any year above 1 it will always fall in the first IF because the first condition will satisfy the…
javascriptanswered 8biT 1,033 -
0
votes2
answers78
viewsA: Which of these options is better and faster for an INSERT in the bank?
Well, I ran some tests and came to a conclusion. Follows the detailing: "Which of these options is better and faster ..." Faster The fastest way to get into the database is to implement with…
-
1
votes2
answers37
viewsA: Do one or more searches in the database with php
If I understand straight you will only have the variable $buscar as a filter, may be an IP, Name or other information. In this case, you can use a OR in your consultation: SELECT * FROM principal…
-
2
votes2
answers793
viewsA: Add data to array() in PHP
Instead of recreating the array only use the array_push(), so you will be sure that new elements will be added. array_push($data, array('cart_type' =>…
-
2
votes1
answer125
viewsA: How to leave the date with Brazilian standard in Codeigniter 3?
You could implement it as follows: else{ $dados = date("d-m-Y", strtotime($data_que_esta_no_array)); ); Useful links: Date strtotime…
-
1
votes2
answers78
viewsQ: Which of these options is better and faster for an INSERT in the bank?
Regarding performance, which of these is the "best" and fastest ? Is there any situation where we should not use any of them or even use only one of them ? After all, everyone plays the same role.…
-
2
votes2
answers128
viewsA: Bank registration via Ajax
You stated $conecta and then uses the $connect. Correct this part that will initially work. Beginning of the code $conecta = mysqli_connect('localhost', 'root', ''); Middle of code (With problem)…
-
0
votes3
answers68
viewsA: selected option
You should make a query in the bank identifying what is the value to be selected. After just go checking in your while and add the selected should you find // Consulta o registro que deve estar…
-
0
votes1
answer107
viewsA: Doubt with foreign key
If I understand correctly you want to know how and if it is possible to relate two columns of a table with another column of another table, not allowing the exclusion of records that are already…
-
0
votes1
answer61
viewsA: How to list values of multiple queries in a single table?
And if we unite the querys it would not be better ? Would something like this: SELECT nome, (SELECT COUNT(*) FROM ATENDIMENTO WHERE NOME = '$nome' AND DAY(data)=DAY(NOW())) AS TOTAL_DIA FROM…
-
1
votes1
answer127
viewsA: While always returns the last record in sql server
If I understand correctly I believe that a Insert with Select would meet your need INSERT INTO TABLEDEBCRED (TOTAL2, EMPCOD2, PLANOCODRED) SELECT @TOTAL2, EMPCOD, PLANOCODRED FROM TABLECONTA WHERE…
-
2
votes2
answers38
viewsA: Codeigniter - Syntax error with select and Where
Alter $this->db->where('ativacao' == '1'); for $this->db->where("ativacao = '1'");
-
0
votes2
answers188
viewsA: How to update only one column of the record?
In a very simple way you can go checking your variables and concatenating in your SQL statement if it is not empty. Example: $query = "UPDATE TABELA SET ". (empty($variavel) ? "" : "CAMPO =…
-
1
votes1
answer624
viewsQ: Problem with Python Graph
Through calculations and mathematical expressions, starting from the information of three data informed by the user (Launch distance - Duration time - Maximum height reached), calculate the speeds…
-
2
votes1
answer31
viewsA: Insert attempt before error (PHP)
In a "manual" way you can implement as follows: $NUM_OF_ATTEMPTS = 5; $attempts = 0; while (($matricula = fgets($handle, 1024)) !== false) { $cont++; erro("Lendo matricula $cont de…
-
1
votes2
answers224
viewsA: Select Inner Join of what is not in the other table
There is more than one way to make this select, it follows some forms: LEFT OUTER JOIN SELECT * FROM ANUIDADES LEFT JOIN PAGAMENTOS ON ANUIDADES.Id = PAGAMENTOS.idAnuidade WHERE…
-
4
votes2
answers120
viewsA: How to use C#quotes?
Here come some forms: public static void Main() { Console.WriteLine(@"Olá 1! Como você está?"); Console.WriteLine("Olá 2!\n"+"Como você está?"); Console.WriteLine("Olá 3! {0}Como você está ?",…
-
0
votes1
answer57
viewsA: Triple information
You only run move_upload_file for file. Change the snippet where you move the file to the destination for a Function and transfer your $_FILES to your new Function Would be next: <?php //…
-
0
votes1
answer1399
viewsA: Typeerror: Cannot read Property '1' of null
Most likely your rawdata.match is null. To avoid error check your rawdata variable before: if (matches) { let type = matches[1]; let buffer = new Buffer(matches[2], 'base64'); }…
-
1
votes4
answers358
viewsA: How to add the amount of days with jQuery
You almost got it right.. instead of using: dtVenc1 = dtVenc1.setDate(dtVenc1 + 7); Try: dtVenc1 = dtVenc1.setDate(dtVenc1.getDate() + 7);…
-
0
votes2
answers795
viewsA: Difference between Comparator and Comparable
The Comparable allows you to say a comparison rule for the class that implements this interface, as a kind of standard rule or official rule, while if you want to escape from this standard rule, you…
-
1
votes2
answers53
viewsA: I need to select which employees are allocated to which projects
These are two correct tables ? In this case try the following: select projeto.nome, funcionario.nome from projeto join funcionario on funcionario.id = projeto.funcionario Check the relationships…
-
1
votes1
answer256
viewsA: PHP search with combobox
isset should work for you. However try using Empty: empty($variavel) Behold here the return of [Sougata Bose] on this type of slaughter. If necessary compare your variable directly: if ($variavel…
-
1
votes1
answer742
viewsA: If with two conditions
Using case when, it would look like this. Example: select sum( (case when tipo = 2 then (valor/cambio) else valor end)) AS IF1, --se a moeda for 2 faça a divisão pelo cambio (case when tipo = 18…
-
0
votes1
answer113
viewsA: Redirect to next page after downtime
Try to put the following snippet on the page where you need this redirect: <META HTTP-EQUIV="Refresh" CONTENT="15 ; URL= pagina.html">
-
1
votes1
answer166
viewsA: Url Amicable Codeigniter
Hello! In fact the route configuration is done as follows: $route['minhaRota/Testando/(:any)/(:any)'] = 'paginas/buscap1/$1/$2'; $route['minhaRota/Testando2/(:any)/(:num)'] =…