0

I want to store Spanish characters in SQL (á, é, í, ó, ú, ü, ñ, ¿, ¡).

Consider the following query:

INSERT INTO students (name) VALUES('áéíóú')

When I run the query in phpMyAdmin the characters are stored correctly.

However, when I run the query from my php code they are stored as áéíóú

Here is the relevant code:

<?php
...
$query = "INSERT INTO students (name) VALUES('áéíóú')";
?>
chris85
  • 23,846
  • 7
  • 34
  • 51
rvelbon
  • 91
  • 5
  • 1
    http://stackoverflow.com/questions/4854446/save-accents-in-mysql-database I believe this is what you're looking for? – Mihir Patel Nov 16 '16 at 23:24
  • http://stackoverflow.com/questions/279170/utf-8-all-the-way-through – Sammitch Nov 16 '16 at 23:36
  • See discussions of "Mojibake" in http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored . – Rick James Nov 17 '16 at 01:47

0 Answers0