Query from php and in Mysql Workbench not same result for special char

Booba__2012

First I did this simple query from MySQL workbench :

UPDATE PRODUIT
SET statut = "Expedié"
WHERE num_ref like "14T500924001"

And it save exactly the same value for statut field. Then I put this query in my php file like this :

$bdd->query('UPDATE PRODUIT SET statut = "Expedié" WHERE num_ref like "14T500924001"'); 

The difference its for the field statut it doesn't take the "é" from "Expedié" ... how can I fix this ? It shows me this : "Expedié"

In my html->head, I put this : <meta charset="utf-8"> but didn't change a lot.

UPDATE1

How I get $bdd :

function ConnexionBDD(){
try{
    $bdd = new PDO('mysql:host=127.0.0.1:3306;dbname=NumeroSerie', 'root');
     $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (Exception $e){
    die('Erreur : '.$e->getMessage());
}
catch   (PDOException $pe)
{
die ("I cannot connect to the database." . $pe->getMessage());
}
return $bdd;    
};
andy

To set your database connection to use utf8 encoding, use

$bdd = new PDO('mysql:host=127.0.0.1:3306;dbname=NumeroSerie;charset=utf8', 'root');

In addition, you need to make sure that your php source file is also encoded in utf8.

Specifying the character encoding in your html with <meta charset="utf-8"> does not change the encoding of your database connection. The alternative to the solution above would be to tell the browser you are sending iso-8859-1 encoding with <meta charset="iso-8859-1">.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Getting same wrong result from query in PHP

From Dev

PHP not displaying result from MYSQL query

From Dev

php array from result of mysql query

From Dev

DB query from PHP gives no result but same query on phpMyAdmin works?

From Dev

PHP nested array from flat MySQL query result

From Dev

How to display multiple result from MySql query using PHP

From Dev

How to display multiple result from MySql query using PHP error

From Dev

How to query one result of genre from array genres in php and mysql?

From Dev

PHP mysql query result to xml

From Dev

Result of a PHP & MySQL query with hyperlink

From Dev

How to call a function from result set in MySQL Workbench?

From Dev

How to call a function from result set in MySQL Workbench?

From Dev

MySQL Workbench Query Preferences

From Dev

Php Mysql query special characters in Row

From Dev

mySQL query is not running in MySQL Workbench

From Dev

How to remove row from Mysql Query result on foreach depending value of the same array

From Dev

convert strings from special char to no special char

From Dev

Use the result of the MySQL SELECT query as a WHERE condition in the same query

From Dev

Mysql database does not show query result in php

From Dev

PHP/MYSQL query no result, encoding wrong?

From Dev

looping php mysql query till no result found

From Dev

mysql query result with join/concat in php codeigniter

From Dev

PHP/MYSQL query no result, encoding wrong?

From Dev

Php MySql Query does not return a result

From Dev

Save mysql query result into a PHP array

From Dev

Echo Result of MySQL SELECT Query in PHP

From Dev

Mysql/Php query grouping filter result

From Dev

MySQL doesn't output PHP query result

From Dev

mysql php: how to properly save a query result

Related Related

  1. 1

    Getting same wrong result from query in PHP

  2. 2

    PHP not displaying result from MYSQL query

  3. 3

    php array from result of mysql query

  4. 4

    DB query from PHP gives no result but same query on phpMyAdmin works?

  5. 5

    PHP nested array from flat MySQL query result

  6. 6

    How to display multiple result from MySql query using PHP

  7. 7

    How to display multiple result from MySql query using PHP error

  8. 8

    How to query one result of genre from array genres in php and mysql?

  9. 9

    PHP mysql query result to xml

  10. 10

    Result of a PHP & MySQL query with hyperlink

  11. 11

    How to call a function from result set in MySQL Workbench?

  12. 12

    How to call a function from result set in MySQL Workbench?

  13. 13

    MySQL Workbench Query Preferences

  14. 14

    Php Mysql query special characters in Row

  15. 15

    mySQL query is not running in MySQL Workbench

  16. 16

    How to remove row from Mysql Query result on foreach depending value of the same array

  17. 17

    convert strings from special char to no special char

  18. 18

    Use the result of the MySQL SELECT query as a WHERE condition in the same query

  19. 19

    Mysql database does not show query result in php

  20. 20

    PHP/MYSQL query no result, encoding wrong?

  21. 21

    looping php mysql query till no result found

  22. 22

    mysql query result with join/concat in php codeigniter

  23. 23

    PHP/MYSQL query no result, encoding wrong?

  24. 24

    Php MySql Query does not return a result

  25. 25

    Save mysql query result into a PHP array

  26. 26

    Echo Result of MySQL SELECT Query in PHP

  27. 27

    Mysql/Php query grouping filter result

  28. 28

    MySQL doesn't output PHP query result

  29. 29

    mysql php: how to properly save a query result

HotTag

Archive