Posts by Thiago Drulla • 132 points
12 posts
-
3
votes3
answers85
viewsQ: Are the variables of a function automatically deleted after its termination?
I am developing a function that has variables that carry a lot of data and as these variables are used only within this function it does not make sense that they continue occupying space in memory,…
-
0
votes2
answers351
viewsA: Inserting data into the database via PHP OO
I’ll give you a basis of what can be done. Create a middle course , for example meuexemplo.php <?php //inclui o arquivo da sua classe require_once "DocModel.php"; //Nesse arquivo você recebe o…
phpanswered Thiago Drulla 132 -
1
votes0
answers34
viewsQ: How to display the result of reading an XML file correctly
Good morning , I came up with the need to read an XML file available in a URL, however , even following the questions already opened here in the stack as :Query the XML URL the data are returned to…
-
1
votes1
answer61
viewsA: Percentage with PHP with ifs
Well your question is very confusing , but from what I understand the percentages you receive can be null at some point and you do not want this null percentage to enter in the calculation, right?…
phpanswered Thiago Drulla 132 -
0
votes2
answers158
viewsA: Field Validation in html and php
In the same way that you created the Insert query you create one that performs select ,the structure using PDO is in this schema: $sql = ("SELECT id FROM cadastro WHERE email=:email"); $teste =…
-
0
votes1
answer254
viewsA: compress/ compress image after upload on my website
From what I understand of your question you want to compress images that users "go up" so in this case the answer already exists right here in the stack and I recommend that you always a searched…
phpanswered Thiago Drulla 132 -
0
votes1
answer217
viewsA: List database query in two columns for the user. - PHP
To do this you must use HTML and follow a structure similar to this just by making the HTML changes you want: echo "<table>"; while($linha = mysql_fetch_array($query)){ echo…
-
2
votes1
answer92
viewsA: Search a Input word in a TXT and find words that are in the same line in PHP
I would recommend that you work with a file in json format that is much more intuitive, at least in my opinion. You can do the following: $json = fopen("caminho do arquivo" . $nomedoseuarquivo .…
-
1
votes1
answer76
viewsA: How to compare arrays?
A hint is you and work with the indexes of the array, because as I understood each position of the array will be a person (position 1 == person 1) for example for($i=0;$i<=10;$i++) { if ($peso[i]…
phpanswered Thiago Drulla 132 -
0
votes1
answer64
viewsA: PHP sends partial data to mysql
Good Morning Juliano , Of a var_dump() in its variable $db , you will probably notice that it does not have any value (NULL), this because you call the file connection to the database conexao1.php…
-
1
votes0
answers66
viewsQ: How to make a Json_decode from a json file
Hello, I am currently storing data in json format in a fopen file. $json = fopen("$root/apil/Controllers/json/" . $this->getX_id() . ".json", "w+"); $customers_results =…
-
2
votes1
answer524
viewsQ: Error creating a fopen file
When trying to create a file in JSON format with fopen I am returned a permission error with the following message: Warning: fopen(/json/9.json): failed to open stream: No such file or directory in…