I was wondering if something like this, is safe in Zend:
$db = Zend_Registry::get('db');
$query = "SELECT * FROM tags t JOIN posts_tags pt ON pt.tag_id = t.tag_id where pt.post_id = " . $postid;
$select = $db->query();
I'm not checking the content of $postid is here.
Zend does this automatically when you make queries like this:
$db = Zend_Registry::get('db');
$select = $db->select();
$select->from(array('p' => 'posts'))
->join(array('u' => 'users'), 'u.user_id = p.post_userid')
->where('p.post_id = ?', $postid);
But I don't like this way of working, just writing queries is much faster for me. So should I be manually escaping or is this done for me? And what are the easiest ways to do this?