PHP MySQL SELECT text truncated

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP MySQL SELECT text truncated

Postby nasht00 » 08. October 2009 22:09

Hi,
I've installed XAMPP using default settings, and I have a problem with my code that I do not have on my real server.

I have a MySQL table like this:

Code: Select all
CREATE TABLE `postings` (
  `posting_id` int(11) NOT NULL AUTO_INCREMENT,
  `poster_id` int(11) NOT NULL,
  `title` tinytext NOT NULL,
  `short_description` tinytext NOT NULL,
  `full_description` text NOT NULL,
  PRIMARY KEY (`posting_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1


And I have a php code to retrieve a row like this:

Code: Select all
function getPostingDetails($posting_id){
        $getPosting = $this->PLAST->prepare('SELECT posting_id, poster_id, title, short_description, full_description FROM postings WHERE posting_id=?');
        $getPosting->bind_param('i',$posting_id);
        $getPosting->execute();
        $getPosting->bind_result($row['posting_id'],$row['poster_id'],$row['title'],$row['short_description'],$row['full_description']);
        $getPosting->fetch();
        $getPosting->close();
        return $row;           
    }


Where $this->PLAST is a MySQLi connection.

In the field 'full_description', I've successfully put a Lorem Ipsum:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. END


The insert works fine since I can see it in phpMyAdmin. However when doing my select, I only get this much:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor i


The $row array I get looks like that:
Code: Select all
Array (
[posting_id] => 1
[poster_id] => 1
[title] => Test 1
[short_description] => This is a short description.
[full_description] => Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor i
)


Why? It works fine when I run the same code in my production server...
nasht00
 
Posts: 1
Joined: 08. October 2009 20:58

Return to XAMPP for Windows

Who is online

Users browsing this forum: Toeopla77 and 110 guests