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...