Posts by touchmx • 1,710 points
67 posts
-
2
votes2
answers2907
views -
0
votes2
answers91
viewsA: Refine article ranking based on views of all articles
The calculation is perfect, what I think is wrong is the fact that the variable $returnHtml is started with stars. In this case, it seems to me that more than 5 stars will be shown. So I believe the…
-
1
votes1
answer42
viewsA: Problem with data change class
In the section below taken from your code you are using a String as argument and not the String type variable. See: String Editar = ("update livros set…
-
13
votes1
answer3872
viewsA: How to put PHP inside an echo?
Just use concatenation. If you want to display dynamic content inside echo, use concatenation. In your case it would be: elseif ( $qtd == 1000 ) { echo $this->__('<a class="askproduct popup"…
-
0
votes2
answers773
viewsA: Program for Public IP Capture
If it is HTTP, just do the following package servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.*; import javax.servlet.http.*; public class ServletIP extends…
-
10
votes3
answers5317
viewsA: Why use get and set in Java?
The use of get and set methods is practiced for safety reasons. The method applied in this case is encapsulation. The goal in fact is to not allow variables to be modified directly. For example,…
-
1
votes2
answers54
viewsQ: Error using libraries in PHP
I’m trying to add the following: require_once __DIR__.'/vendor/autoload.php'; require_once __DIR__.'/settings.php'; require_once __DIR__.'/resources.php'; require_once __DIR__.'/utils.php'; use…
-
1
votes1
answer60
viewsA: Show PHP table data
create an empty variable of the Array type outside your loop. Then inside the for, use the array_push function to insert at the end of the variable the result found. To go through the variable use…
-
4
votes2
answers1529
views -
1
votes2
answers1048
viewsA: How do I change the value of a PHP variable by clicking a link?
A "simple" way would be, Use Ajax and $_SESSION. You create a session and each click sends a message via ajax to a page that updates the session value. $_SESSION['contador'] += 1; Then recover the…
-
3
votes4
answers1308
viewsA: I cannot concatenate variable in a query
Checks whether the value of $Cod[4] is really the value you need. But if the ID is the last value of the URL, do it this way: $valor_id = $_SERVER['REQUEST_URI']; $cod = explode("/",$valor_id);…
-
3
votes1
answer853
viewsQ: Time interval query in mongodb using pymongo
I need to perform a query in a mongodb database that results in a set of results per time range. I am using pymongo. My consultation is as follows: queryConsulta = {"$and": [ {"id_no": id_node},…
-
1
votes3
answers165
viewsA: Rotate text and replace first link
try as follows: $string = SUA_STRING; preg_match_all('https?://(([^ .]+)\.)+[^ .]{2,4}(/[^ /]+)', $string, $conteudo); $link = $conteudo[0][0];//link
-
3
votes1
answer58
viewsQ: Autocomplete via java doc in sublime
I don’t know if I can express myself properly, but come on. In Java, when commenting on the code, we use the default /** * @author Nome do Autor; * @method Nome do Método; */ From this, in an IDE…
-
1
votes3
answers165
viewsA: Rotate text and replace first link
My dear, you will need to use a regular expression to get every value you have as a http or https start. It would be something less in this idea: https?://(([^ .]+)\.)+[^ .]{2,4}(/[^ /]+)*…
-
1
votes7
answers3667
viewsA: PDO does not connect to Mysql
When this kind of problem occurs what can happen: if you are using windows. may not have the respective dll Mysql port installed is not the default (3306) Database data is not correct…
-
1
votes3
answers3146
viewsA: Error when performing a database query
The $id parameter you pass is a String? If it is, do the following test. public function getChamado($id) { try { $id = (int) $id; $cols = array( 'id', 'titulo', 'descricao', 'fk_status', 'fk_local',…