• Check out my article about this issue:

  • Your link doesn’t work…

  • Ben

    Looks like this is what he meant to link: http://codeaid.net/search/quoteinto

  • Yes, it seems so. But a better idea would be this:

    Not tested, but it should work!

  • Nice! But I’m quite sure that it wasn’t working one year ago when the article was written 🙂

  • Alex

    tested and works!

  • Matheus

    I like this! Thanks man!

  • developer-si

    Isn’t the quoteInto() approach ment to encapsulate the native SQL syntax to achieve the database independence?

  • phpspider

    But what in case of LIKE… ??

  • It’s exactly the same:

  • Kevin Smith

    Or, you could do it a much better way, this is a join clause example, you can either store this in a variable or add it directly to the object as below. Much better to read and no writing out the SQL statement.

    \join(' AND ', array(
    'qsct.id = asct.question_section_id',
    $db->quoteInto('asct.lft > ?', $answerSection->getLft(), 'int'),
    $db->quoteInto('asct.rgt getRgt(), 'int')

Advertisment ad adsense adlogger