Questions tagged as 'php'

2
answers

Return from json_encode takes the order of asort ()

The asort() method is used to sort arrays, without losing the index. I do the sorting, both in the SQL search and in the array. However, when sending the data via JSON (using json_encode ), it reorders the keys. Array example, so...
asked by 15.02.2017 / 18:59
1
answer

Sending Data via Link (POST or GET)

Good morning my dear ones, I'm new here ... First of all, I want to point out that I already read the topics that exist in this forum and I could not solve my problem! My problem is to send only the id of the bank from one PHP page to anot...
asked by 18.02.2017 / 12:44
1
answer

What is the "correct way" to use destructors in PHP

When looking for references to good practices in PHP for memory management, I came across a number of ways to use destructors . I know the main actor is the Garbage Collector but this one is not Garbage Collector is part of the...
asked by 08.03.2017 / 10:17
1
answer

Error Warning: mysqli_fetch_array () and no error returned in mysqli_error

I have a simple error and can not find a solution, it seems to me that my problem is different from this answer here . The error message is this: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, array given in **** o...
asked by 02.03.2017 / 16:38
1
answer

problem with multidimensional array does not take value

$dados= '{"nome":"teste","cpf":"teste"}'; $value = json_decode($dados, TRUE); foreach($value as $in) { $nome = $in->{'nome'}; $cpf = $in->{'cpf'}; } I'm trying to get the data, but the value name and cpf comes null !!!     
asked by 14.03.2017 / 14:06
2
answers

How to sort a select with 2-in-2 results

I am creating a system where the user informs the name and time of birth. I wonder if you can solve the following question: I have the following table: Havingthenameandtimeofbirth,thesystemadministratorinformsthepriorityofeachrecord,being:1=...
asked by 01.03.2017 / 18:07
1
answer

PDO exec returning false

I'm doing an online course on PHP with PDO and I'm having trouble right away in the first class, with the code: <?php $pdo = new PDO('mysql:host = localhost, dbname = curso_php_oop', 'root', ''); //instanciando a classe do PDO, iniciando c...
asked by 06.03.2017 / 17:38
1
answer

Hexadecimal string cut when inserting with PDO

Good afternoon everyone! I would like some help from you to solve a problem that is happening to me. I have a hexadecimal string containing an image that should be added to the database, when I insert it with the PDO without the bindValue, passi...
asked by 09.01.2017 / 15:15
2
answers

Session without the www and with the www php [closed]

Hello, I'm having a problem, it happens that the user logs on to www.mysite.com his session does not stay in mysite.com, why does it have this difference of www and www? Can anyone help me? I'm setting the session normally session_st...
asked by 03.01.2017 / 13:04
1
answer

How to confirm the UPDATE with PDO

Do you have a function in the PDO that allows you to check if the UPDATE was successful? Same as method 'lestInsertId ()' is used to check if a new ID was generated in a table with auto increment after an INSERT.     
asked by 13.01.2017 / 01:20