Skip to main content
deleted 43 characters in body
Source Link

Adding to @GDP's answer

...
$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
$query->insert($db->quoteName('#activity_log''#__activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);

$db->setQuery($query);
$result = $db->execute();...

Adding to @GDP's answer

$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
$query->insert($db->quoteName('#activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);

$db->setQuery($query);
$result = $db->execute();

Adding to @GDP's answer

...
$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
$query->insert($db->quoteName('#__activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);
...
deleted 59 characters in body
Source Link

Adding to @GDP's answer

$query = $db->getQuery(true);
$query->clear();

$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
$query->insert($db->quoteName('#activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);

$db->setQuery($query);
$result = $db->execute();
$query = $db->getQuery(true);
$query->clear();

$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
$query->insert($db->quoteName('#activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);

$db->setQuery($query);
$result = $db->execute();

Adding to @GDP's answer

$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
$query->insert($db->quoteName('#activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);

$db->setQuery($query);
$result = $db->execute();
deleted 135 characters in body
Source Link
$query = $db->getQuery(true);
$query->clear();

// Insert columns.
$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
// Prepare the insert query.
$query->insert($db->quoteName('#activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);
 
// Set the query using our newly populated query object and execute it.
$db->setQuery($query);
$result = $db->execute();
$query = $db->getQuery(true);
$query->clear();

// Insert columns.
$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
// Prepare the insert query.
$query->insert($db->quoteName('#activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);
 
// Set the query using our newly populated query object and execute it.
$db->setQuery($query);
$result = $db->execute();
$query = $db->getQuery(true);
$query->clear();

$columns = array('user_id', 'type', 'object', 'lvl', 'date');
$values  = array();
foreach ($batch as $row) {
    $array    = array(
        $row->user_id,
        $db->quote($row->type),
        $db->quote($row->object),
        $db->quote($row->lvl),
        $db->quote($row->date),
    );
    $values[] = implode(',', $array);
}
$query->insert($db->quoteName('#activity_log'));
$query->columns($db->quoteName($columns));
$query->values($values);

$db->setQuery($query);
$result = $db->execute();
deleted 85 characters in body
Source Link
Loading
Source Link
Loading