Questions tagged as 'php'

1
answer

JSON return conversion error for JAVA Class

I have a java class public class PRODUTO extends SugarRecord implements Parcelable { private float id_pro; public PRODUTO(float id_pro){ this.id_pro = id_pro; } public float getId_pro() { return id_pro; } public void s...
asked by 16.05.2018 / 07:11
2
answers

form has a problem retrieving the value of Post

I'm doing a site and I wanted it so that the person typed in the link javascript would pick up and send the form but he is sending it but when I try to recover it with $ _POST it n retrieves the value that was sent q code I'm using . <?php...
asked by 14.05.2018 / 01:15
1
answer

Why in PHP and MySQL! is converted to 0 in some cases?

The question is the title alone, in PHP we can do: var_dump((int) "!"); And receive int(0) . And in MySQL we can do: SELECT campo_int FROM tabela WHERE campo_int = "!" And if that 'campo_int' is '0' it returns th...
asked by 09.11.2017 / 16:55
1
answer

How to check in a TXT if something repeats itself?

I have a TXT file storing data separated by | and would like php to check if there is anything there repeating itself as I do? In TXT the data looks like this: ID|NOME|TELEFONE|ENDERECO|REFERENCIA Every added client saves a line of this...
asked by 15.11.2017 / 19:31
2
answers

JSON does not accept accent

Friends, I have a problem, the string that has an accent can not get it using JSON: $imagens = array(); $sql = mysql_query("SELECT * FROM texto_index"); while ($row = mysql_fetch_row($sql)){ $imagens[] = $row; } echo json_encode($imagens...
asked by 01.07.2014 / 18:13
1
answer

Ajax crashes the computer

Review the code below function update(){ $.ajax({ url : 'http://localhost/sistema', type : 'get', dataType : 'json', success : function( data ){ console.log('Mostrar dados: '+.data.dado); } }) } setInterval(fun...
asked by 24.04.2018 / 16:07
1
answer

PHP - accept break lines

I made a preg_match where it accepts several characters. At the moment I wanted to accept BREAK LINE also, when a person press ENTER to go down the line. How do I do it? Example of what I did: !preg_match('#^[a-z0-9\-+, .\#*()...
asked by 27.04.2018 / 20:34
2
answers

"Convert" an HTML list to MySQL with PHP

I have a large HTML list with about 106000 lines of code. Where these lines are records and these records are subdivided into: 6 lines of information about a game (as name and year of publication) 1 line break So, each "record" in my HT...
asked by 10.09.2014 / 07:45
1
answer

PDO showing connection data if trigger of catch within the alert (result)

Because in my% ajax%, the catch of alert(result) is showing my connection information to the database as shown in the following image: link Code: $pdo = new PDO("mysql:host=localhost; dbname=meubanco", "meuuser", "minhasenha");...
asked by 30.08.2014 / 20:49
2
answers

Variable equal to itself if the result of the logic is false

Consider the following code: $a = $b > $c ? $c : $b; The question is, if $ b is a set of operations, if the result of logic $ b > $ c is false, I will have to repeat all the existing operation in $ b. I did this, but I wonder if th...
asked by 29.08.2014 / 22:27