PDO using fetch() for varchar column
Posted: Mon Mar 15, 2010 5:14 pm
i have the following table
blog_id int(11)
title varchar(255)
blog varchar(4000)
status varchar(1)
date_created datetime
date_modified datetime
if have the following query
the title shows up fine but the blog doesn't. i've even changed blog to varchar(255) thinking it might have something to do w/ the length since my title column is displaying but no luck. am i missing something?
blog_id int(11)
title varchar(255)
blog varchar(4000)
status varchar(1)
date_created datetime
date_modified datetime
if have the following query
Code: Select all
$stmt = $dbh->prepare("
SELECT *
FROM `blog`
WHERE `status` <> 'D'
ORDER BY `date_created` DESC
");
if ($stmt->execute())
{
if ($stmt->rowCount() > 0)
{
while ($row_blog = $stmt->fetch())
{
echo '<div>'.$row_blog['title'].'</div>';
echo '<div>'.$row_blog['blog'].'</div>';
}
}
}