0

I had some code that worked fine but i moved hosts and now I can't save long text in MySql text field

$conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"));

$sql = "UPDATE PdfMenu SET Note=?, Date1=?,Date2=?, Box1 =?, Box2 =?, Box3 =?,Box4 =?,FootNote=? WHERE id =?";
    $q = $conn->prepare($sql);
    $q->execute(array(stripslashes(word_cleanup($notes)),
                        stripslashes($datepicker),
                        stripslashes($date2),
                        stripslashes(word_cleanup($box1)),
                        stripslashes(word_cleanup($box2)),
                        stripslashes(word_cleanup($box3)),
                        stripslashes(word_cleanup($box4)),
                        stripslashes(word_cleanup($bottomNotes)),
                        stripslashes($menuid)
                        ));

$notes should be stored in field 'Note' (Type: text, Collation: utf8_general_ci) but it won't store text, it's just blank

All other fields are saved and there is no error message

HiSpec
  • 125
  • 3
  • 12
  • To ask a question about pdo and mysql you have to provide a code that involves **PDO and mysql only**. While asking whys some of your own variables of the unknown origin isn't stored in database is offtopic – Your Common Sense May 12 '14 at 14:40
  • @ÁlvaroG.Vicario if only one field gets blank while others saved there should be no error... though, one never can tell from such a question. – Your Common Sense May 12 '14 at 14:42
  • All other fields are saved and there is no error message – HiSpec May 12 '14 at 14:45
  • I don't understand the use of stripslashing at all, but the function `word_cleanup()` seems to be a very thorough one. – VMai May 12 '14 at 14:50

0 Answers0