Could this be the reason for Suspension event . I am trying to add and update data to SQL could this be the reason I have to my only database it acually does not perform the update idk.
PHP
$base64artwork = base64_encode($artwork);
try {
$sql = "INSERT INTO `played_songs` (`song`, `artist`, `album`, `length`, `bpm`,`genre`, `listeners`,`track_user_rating`,`track_user_num`,`comment`,`ImageBase64`,`lyrics`,`year`) VALUES ('$title','$artist', '$album', '$length', '$bpm',
'$genre','$listeners','0','0', '$comment','$base64artwork','','$year') ON DUPLICATE KEY UPDATE `listeners`='$listeners'";
$result= OpenPDO($conn,$sql,$_execute,"");
}
try {
$sql ="UPDATE `played_songs` SET `lyrics` = '$lyrics' WHERE datetime = (select max(datetime) FROM `played_songs`)";
$result= OpenPDO($conn,$sql,$_execute,"");
} catch(Exception $e) {
//$result->rollBack();
ReturnError($code, "An Error occurd updating record in SQL");
}
}
But this doesn't seem to update the last created record and the record string is to long to add it to the first/. I get 3% CPU use when its running so cannot understand why it falls over
I would point out this UPDATE `played_songs` SET `lyrics` = '$lyrics' WHERE datetime = (select max(datetime) FROM `played_songs`) works in the PHP Admin test so why not from PHP. I dont understand why it fails. Is there tech support here?