Hi I am not getting $lyrics populated in SQL

I have

PHP

try {

 $result= OpenPDO($conn,"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','$lyrics','$year') ON DUPLICATE KEY UPDATE `listeners`='$listeners'",$_execute,"");

} catch(Exception $e) {

  $result->rollBack();

  ReturnError($code, "An Error occured inserting record to SQL");

}


It just doesn't insert lyrics which is multi line string set in database as longtext

 $lyrics = implode($xml->xpath('//PLAYER/TRACK/@LYRICS'));

Comments

  • I think the data choice might be wrong for multi line string