Questions tagged as 'php'

4
answers

Clear the browser cache after uploading version

I have the following scenario: Each month we release new versions for our customers, and most of the time our customers call telling us that X functionality is not working the way it should. Because it is usually running a function that is from...
asked by 26.02.2016 / 16:00
3
answers

How to group SQL results by month and year?

I would like to know how I can query the MySql database and group the records by year and month. At the moment I first make a query to get the year records, then for each year I use a for () to filter the results per month within that year....
asked by 09.11.2016 / 20:36
4
answers

Script making too many wrong requests

I am in the following dilemma, which may be simple for many here, however, as I am a beginner, I am experiencing a major difficulty in a system I am supporting ... When you click a button, you run a script that returns data in JSON. However...
asked by 04.08.2015 / 21:51
3
answers

How to ask the PDO if the insertion was made or gave an error?

How to ask $Produtos if the insertion was made or if there was an error in insertion attempt type or die of mysql ? if(isset($_POST['cadastra_produtos'])){ /////////////////////////////////// $Produtos = $pdo-&...
asked by 16.11.2014 / 00:48
4
answers

How to alter American format dates and / m / d for d / m / y?

I bought some systems but all of them come with date fields in English, as well as the American standard: year / month / day. How do I convert to day / month / year format?     
asked by 15.07.2014 / 23:50
3
answers

Make PHP account in the order that is in the string

I need an order of calculation that is in the string to be done in the order that is in it. For example: $string = '(10*10)+(30-5)/2'; I need PHP to interpret this not as a string , but rather as a calculation and do according to what ha...
asked by 08.09.2016 / 03:00
2
answers

Post system - "Duplicate entry '0' for key 'PRIMARY"

I'm having a problem, I'm not really sure if it's in PHP or in the database. In a posting system using PHP, as soon as you submit a notice, ID (the primary key, which would be used like this: index.php?ID=0 ) is not changing, ie...
asked by 20.07.2015 / 15:07
3
answers

Uploading file with php

I'm using the following code: $uploaddir = '../vagas/'; $uploadfile = $uploaddir . basename($_FILES['img']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "Arquivo válido e enviad...
asked by 19.10.2015 / 00:46
3
answers

Divide a string that contains scores

I'm trying to split the following string Eu irei amanhã à casa. E tu vens? To get the following result inside an array in php array( [0] => eu [1] => irei [2] => amanhã [3] => à [4] => casa [5] =>...
asked by 25.01.2017 / 19:38
3
answers

Convert object to json in php

I'm trying to create a class that saves objects of type Conta to a json file, however, when saving the file, the object information is not saved, just this:    [[], {}] My class that is reading and saving in json is: class JSONCu...
asked by 10.11.2015 / 18:13