So i'm building an app for Shopify. Because of the way Shopify works, we annoyingly have to deal with vendors by name, rather than having a numeric uid.
This has posed some problems for us. We have a vendor that was imported into our database from Shopify as "Colección Luna". Doing the following works fine:
SELECT email FROM vendors WHERE name=('Colección Luna') LIMIT 1
This returns the data that we are looking for. However, in php, if we do something like this:
$row = mysql_fetch_row(mysql_query("SELECT name FROM vendors WHERE name=('Colección Luna') LIMIT 1"));
echo $row[0];
This will output:
Colecciu00f3n Luna
This is a problem, because we use the vendor name as our uid in all cases that we are dealing with them. Using the name that we get from the database to find the email for example would cause our sql statement to look like this:
SELECT email FROM vendors WHERE name=('Colecciu00f3n Luna') LIMIT 1
Which ultimately doesn't find the data that we're looking for because of the difference in characters.
I assume that php is encoding its strings in utf-8 by default, is there a way that I can force it to output its strings in the same format as the database?
Many thanks in advance.