My code below is not a complete solution, copy/Paste will not work. It is intended to push you in the right direction. I suppose my code may have some errors, although I’m not seeing it. If anyone finds the error, please, DEIXE UM COMENTÁRIO.
First I wanted to know why you converted the results to Json before saving to the bank. You already have an array, you don’t need a JSON string in your case. You need to convert back with this:
$yourArray = json_decode($json)
Now you can enter the data into the table. I don’t know how your Insert is , but if I look at your code, I think your sql would look something like this:
$sql = 'INSERT INTO tabela(id, nome_completo, idade, cidade) VALUES (:id, :nome_completo, :idade, :cidade)';
So your code would look something like this:
$stmt = $db->prepare( $sql );
$sql = 'INSERT INTO tabela(id, nome_completo, idade, cidade) VALUES (:id, :nome_completo, :idade, :cidade)';
$stmt->bindParam(':id', $yourArray ['id']);
$stmt->bindParam(':nome_completo', $yourArray['nome_completo']);
...
$stmt = $dbh->prepare( $sql );
$stmt->execute();
This is the correct way to store your "Json" data, so you can make select smoothly.
What database are you using? I ran a test here on Mysql and SQL Server 2008 and both returned the right result.
– André Ribeiro
@Andréribeiro I’m using Mysql.
– Filipe Moraes
Add to your question the PHP code you are using. It might be something there.
– André Ribeiro
@Andréribeiro I’m using phpmyadmin I removed the PHP tag to avoid confusion.
– Filipe Moraes
Try
WHERE custom LIKE '%Ana Conceição Dias%'
– bfavaretto
@bfavaretto tried that too and it didn’t work.
– Filipe Moraes
Try then escaping each bar: \
– bfavaretto
@bfavaretto succeeded, but using 4 bars. " Ana Concei u00e7 u00e3o Dias".
– Filipe Moraes