Posts by Paulo Victor • 643 points
24 posts
-
0
votes2
answers3544
viewsA: SQLSTATE[HY000]: General error: 1364 Field 'gender' doesn’t have a default value
This error is usually caused by you not specifying all values while Mysql/mariadb Strict Mode is active. To deactivate, open my.cnf or my.ini and add the line sql_mode= Or run the command to…
-
1
votes0
answers133
viewsQ: Restsharp taking his time making the first requisition
I am making an application using Xamarin Native and I decided to use Restsharp to make the requests to my API, the problem is that the first request made takes a few seconds (some 3) to be made,…
-
2
votes1
answer81
viewsA: Pass PHP ID for javascript to a page
Here’s what you can do. Before including or writing javascript code, set a constant with your id, example: <script> const idTarefa = <?php echo $idTarefa ?>; </script> And your…
-
0
votes2
answers72
viewsA: Send several files in a form
You can access the various uploads through a foreach, or if you prefer, manually access (Example: $_FILES['arquivo'], $_FILES['arquivo1']...) If you want to do a foreach, you can do something like:…
phpanswered Paulo Victor 643 -
1
votes1
answer66
viewsA: everything I’m using on this site HTML + CSS + JS + PHP
You will need to make an ajax request to a script that saves the content. Your php would look like this: save php.: <?php $data = $_POST['content']; file_put_content('conteudo_do_site', $data);…
-
5
votes1
answer4362
viewsA: Free Mysql remote access 8
The bind_address can be removed or replaced by * and you must create a user with global access (using wildcard %) or specify the host that can connect to it. If you use Mysql < 8 or Mariadb 10.X:…
mysqlanswered Paulo Victor 643 -
0
votes2
answers35
viewsA: algorithm not doing the necessary checks
You have not set any value for x so it has by default the value 0, look at the condition "if v1 mod x is equal to 0", there is a division by zero. To check if it is prime, the number must be divided…
visualganswered Paulo Victor 643 -
0
votes2
answers811
viewsA: Oracle JDK 8 is NOT installed
Looks like the installer hasn’t been updated yet. You can try downloading directly from the oracle repository, try these commands: cd /var/lib/dpkg/info sudo sed -i…
-
2
votes1
answer845
viewsA: What is the "->" operator for?
a->b is the equivalent of (*a). b, it takes the member called bar from the structure where foo is being pointed. It’s basically a shortcut to (*a). b More information:…
canswered Paulo Victor 643 -
1
votes2
answers46
viewsA: Problem for displaying the values of an Array on the front end
What happens is that you are not returning any value in the search function, so the value of $return is as null. To solve this, you must change print_r($inf); for return $inf; Check out the…
-
0
votes1
answer45
viewsA: Enum class not accepting check
You must convert your Enum class to INT as well, or else convert the type variable to your Enum class, and you are casting wrong. To convert string or char to INT, you must use the atoi function();…
-
2
votes2
answers1639
viewsA: How to Instantiate an Object in C#
You must pass the instance of the object created by a function and save to a property in its new class. Example: First create a class that has a property with the desired class type: public class…
-
5
votes2
answers147
viewsA: Compressing files with PHP 5.1.6
To use ZIP in PHP 5.1 you must install the pecl extension ZIP The code is right, just install the extension. Since php is kind of old, you will have to compile the extension on your own. You can…
-
3
votes1
answer294
viewsA: Download zip file from a URL
You don’t have to do this gambit with while, you can use the downloadfile without being async, because you don’t need it async. In case your code would be: var localPath =…
-
1
votes2
answers45
viewsA: Exception with variables
As you are using Cin, you should check your failbit, can do this in two ways: if (!cin) { trow "Tipo errado"; } OR cin >> x; while (!cin.good()) { cin.clear(); cin.ignore(INT_MAX, '\n') cin…
-
0
votes1
answer137
viewsA: Why does FILTER_SANITIZE_EMAIL not remove some special characters?
According to the PHP documentation for the FILTER_SANITIZE_EMAIL Removes all characters except letters, digits and !#$%&'*+-=?^_`{|}~@.[]. And according to RFC for the syntax of an email, in the…
-
1
votes1
answer209
viewsA: Replace Iframes
You can use the jQuery.each(): Example: $(document).ready(function(){ $("iframe").each(function() { //src = source do iframe, no caso, o link para se redirecionar var src= $(this).attr('src');…
-
2
votes1
answer289
viewsA: How to group radio Buttons
You can set the name as an array, it would look like this: <div class="col-12"> <div class="form-row"> <div class="form-group"> <label>Pergunta 1</label> <input…
-
0
votes3
answers1996
viewsA: Open external videos(mp3/mp4) with PHP
As the PHP documentation tells to the readfile function, A URL can be used as a filename if fopen Wrappers is active. See fopen() for more details on how to specify Urls as a filename. See also the…
-
4
votes1
answer97
viewsA: How to read this example of Json correctly?
JSON returns several array’s, and address is another one of them. You can do a foreach in this array or else always choose to access the first index, your code would look like this: <?php…
-
2
votes1
answer187
viewsA: How to insert HTML using PHP in indented form
You can use Heredoc But the recommended is that you create a separate php file with html and include it Heredoc example: print <<< END <p> Seu código HTML<br/> </p> END;…
-
0
votes1
answer74
viewsA: Read data over file . csv
You are probably trying to pass bars to int, the highest value for int32 is 2 32-32, try passing the value to string or try using a 64-bit version of php, which accepts int64
-
0
votes2
answers90
viewsA: Warning: scandir(/game/c_images/album1584/): failed to open dir: not implemented in
You are trying to check if $target is a folder, but you have defined it as a link. In this case, $target must be $target = ". /game/c_images/album1584/"; if the game folder is in the same folder as…
-
0
votes3
answers503
viewsA: I cannot display the output of a SELECT COUNT (MYSQL) in the HTML page
You should use mysql_num_rows (I recommend migrating to Mysqli incidentally) Documentation Your final code will be: <?php $select_pendentes = "SELECT count(codigo) from tbl_atividades WHERE…