Trouble with images in teasers
Hey all,
I cannot get images from the image module or CCK images to show up in the teaser.
I've tried basically everything and really need to add this functionality so I'm trying to write a custom query to find the image myself and then output it.
However, I'm getting infinite errors with my SQL query and I cannot figure out for the life of me why. It's probably a syntax error, but I cannot find it. Any help would be much appreciated.
This code works:
$result = db_query("SELECT n.nid FROM {node} n WHERE n.type = 'article' and n.status = 1");
but when I try to search for a dynamic title, such as:
$result = db_query("SELECT n.nid FROM {node} n WHERE n.title = '$title' and n.status = 1");
it doesn't work, even though when I search for the actual title in ' 's it works just fine.
Any ideas?

perhaps it might be better
perhaps it might be better to focus on the first issue, why aren't images showing on teasers?
how are you generating your teasers?
have you checked your display settings?
are you using views, imagecache etc etc?
have you modified node.tpl.php or perhaps built a custom node-my_content_type.tpl.php and can't get the code to work for you?
I figured out the problem...
I figured out the problem is that I have a Teaser module installed which apparently doesn't include items added by the Image module, but I was able to work around it.
However, I'd still like to figure out how to selected something from the SQL table dynamically, it seems like there is no reason it shouldn't work. I must be missing some small detail.
Thanks for the response! :-D