joomla database methods

前端 未结 1 380
南笙
南笙 2020-12-21 05:32

How do I use in case of Joomla the mysqli bind_param

how would this example should be declared using joomla Database methods?

...
$state         


        
相关标签:
1条回答
  • 2020-12-21 06:14

    In Joomla! 3.1, PDO/Sqlite and PDO/Oracle are supporting prepared statements, others are not implemented yet.

    Given using a 'preparable' connection, it would work this way:

    $db    = JFactory::getDbo();
    $query = $db->getQuery(true);
    $query->select('...')->where('...');
    
    $query->bind(':s', $like);
    
    $db->setQuery($query);
    
    $records = $db->loadObjectList();
    
    0 讨论(0)
提交回复
热议问题