Hi everyone, I have inherited a site written in php, and I’m not the most experienced php coder (by a LONG way ). The site is intermittently getting this error when doing mysql inserts:
Decoding error! The response was : HTTP/1.1 200 OK Date: Fri, 06 Sep 2013 10:59:19 GMT Server: Apache X-Powered-By: PHP/5.2.17 Set-Cookie: PHPSESSID=lo4au4skm1jshu1rs7a2rve5i4; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 197 Connection: close Content-Type: text/html; charset=UTF-8 ERROR (US.2): Team Update Failed!
Now I’ve checked the sqlstate, error, errno and they are all empty, and it does appear the update is working. My question is how do I track down what this “Decoding error!” actually is?
The data is being read from XML to be inserted to the DB.
The database is UTF_UNICODE_CI.
Thanks
$mysqli = new mysqli('xxx','xxx','xxx','xxx');
$mysqli->set_charset("utf8");
$query = "INSERT INTO `team`
SET
id = '".$teamArray['id']."',
name = '".$teamArray['teamName']."',
league = '".addslashes($league_id)."',
conference = '".$teamArray['conference']."',
season = '".addslashes($season_id)."',
wins = '".$teamArray['wins']."',
losses = '".$teamArray['losses']."',
pf = '".$teamArray['pf']."',
pa = '".$teamArray['pa']."'
ON DUPLICATE KEY UPDATE
name = '".$teamArray['teamName']."',
league = '".addslashes($league_id)."',
conference = '".$teamArray['conference']."',
season = '".addslashes($season_id)."',
wins = '".$teamArray['wins']."',
losses = '".$teamArray['losses']."',
pf = '".$teamArray['pf']."',
pa = '".$teamArray['pa']."'";
$items = $mysqli->query($query) or die("ERROR (US.2): Team Update Failed!");