Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools

    $db = JFactory::getDbo();
    $query = $db->getQuery(true);
    $columns = array('TIMESTAMP', 'USERIP', 'DOMAIN', 'ARTICLE','AUDIT','HTML');
    $values = array('NOW()', $db->quote(getRealIpAddr()), $db->quote($domain), $db->quote($article), $db->quote($audit), $db->quote($htmltext));
    ->values(implode(',', $values));

$columns is an array of column names, $values is the corresponding array of values. Use $db→quote() to get rid of any reserved characters and prevent sql injection attacks

/data/webs/external/dokuwiki/data/pages/joomla/write_to_the_database_using_database.txt · Last modified: 2019/05/20 10:12 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki