Questions tagged as 'php'

2
answers

How and when to use exceptions in PHP?

In PHP, most native functions return a boolean false , integer 0 or NULL if some kind of inconsistency is found in the value passed to it. Example: $exemplo1 = explode("","tente me explodir"); // false //ou $exemplo2 = coun...
asked by 19.06.2014 / 23:18
3
answers

How to retrieve ID of the last record recorded with MySQLi

I am not able to retrieve the ID of the last record inserted in my DB, it is coming as Zero, the inclusion is working and at the moment of making an update the script fails. I have tried with mysql_insert_id() and mysqli_insert_id()...
asked by 13.05.2015 / 15:36
2
answers

Return with all the lines of the foreach

I have the following script : <?php $recursos_data = array( array( "id" => "0", "recurso_nome" => "madeira", "producao" => "%produz%", "estoque" => "200"...
asked by 28.10.2014 / 00:22
2
answers

Sort words with accents in PHP

I am trying to alphabetize an array in PHP, where the key of each array position is a word. I'm using ksort . Sorting works, the problem is that accented words such as "acid" are placed at the bottom of the list. I need to make the...
asked by 09.10.2014 / 18:27
2
answers

How to access JSON values coming from ajax in a PHP page?

I passed these values via ajax: $.ajax({ url: '/loterias/cadastro.php', type: "POST", data: "{'numeros': '" + numeros + "', 'jogo':'" + jogo + "'}", dataType: 'application/json; charset=utf-8', success: function (data) {...
asked by 27.09.2014 / 17:32
3
answers

Making an OCR with no dependencies in PHP

I have a project where people do schedule quotes for Tumblr. Today it works from the Kindle and I'm already seeing the Kobo files. But today I ask for help for the third part: I would like to add an OCR reader , so that the person could uploa...
asked by 20.08.2014 / 19:19
2
answers

How to insert multiple arrays into a MySQL table

I get via Ajax a $_POST request with 5 indexes and the last 3 are Arrays. It looks something like this: Array ( [c] => [s] => [dt] => [nl] => Array ( [0] => valor1 [...
asked by 07.04.2014 / 02:51
3
answers

GROUP BY last record

I'm doing a query in the database, follow my table below id | protocolo | status | alteracao | datahora 1 2 1 teste 2014-11-10 15:23:44 2 2 3 teste 2014-11-10 14:23:44 3 2 4...
asked by 10.11.2014 / 18:47
3
answers

How to force a download with ajax?

I'm using the PHP DOMPDF class to generate accounts with dynamic filters. The user selects the filters in a form and asks to generate, so far so good. But it will have the option of exporting what it has filtered into PDF. Today, I have th...
asked by 03.05.2014 / 15:29
3
answers

Running jar on client from browser

I need to run a jar file that should be on the client's pc through the web and pass some parameters to that jar, I managed to do this with exec() of php: exec('java -jar "C:\Users\Suporte01\Documents\NetBeansProjects\Printer\dist\Printe...
asked by 26.02.2014 / 13:41