Example #1
0
/**
 * get the warning messages array
 *
 * @return array  $warning_essages
 */
function PMA_getWarningMessages()
{
    $warning_essages = array();
    foreach (PMA_DBI_get_warnings() as $warning) {
        $warning_essages[] = PMA_Message::sanitize($warning['Level'] . ': #' . $warning['Code'] . ' ' . $warning['Message']);
    }
    return $warning_essages;
}
Example #2
0
        }
        $insert_id = PMA_DBI_insert_id();
        if ($insert_id != 0) {
            // insert_id is id of FIRST record inserted in one insert, so if we
            // inserted multiple rows, we had to increment this
            if ($total_affected_rows > 0) {
                $insert_id = $insert_id + $total_affected_rows - 1;
            }
            $last_message = PMA_Message::notice('strInsertedRowId');
            $last_message->addParam($insert_id);
            $last_messages[] = $last_message;
        }
        PMA_DBI_free_result($result);
    }
    // end if
    foreach (PMA_DBI_get_warnings() as $warning) {
        $warning_messages[] = $warning['Level'] . ': #' . $warning['Code'] . ' ' . $warning['Message'];
    }
    unset($result);
}
unset($single_query, $query);
$message->addParam($total_affected_rows);
$message->addMessages($last_messages, '<br />');
if (!empty($warning_messages)) {
    /**
     * @todo use a <div class="warning"> in PMA_showMessage() for this part of
     * the message
     */
    $message->addMessages($warning_messages, '<br />');
    $message->isWarning(true);
}
Example #3
0
/**
 * Get warning messages array
 *
 * @return array  $warning_messages
 */
function PMA_getWarningMessagesArray()
{
    $warning_messages = array();
    foreach (PMA_DBI_get_warnings() as $warning) {
        // In MariaDB 5.1.44, when altering a table from Maria to MyISAM
        // and if TRANSACTIONAL was set, the system reports an error;
        // I discussed with a Maria developer and he agrees that this
        // should not be reported with a Level of Error, so here
        // I just ignore it. But there are other 1478 messages
        // that it's better to show.
        if (!($_REQUEST['new_tbl_storage_engine'] == 'MyISAM' && $warning['Code'] == '1478' && $warning['Level'] == 'Error')) {
            $warning_messages[] = $warning['Level'] . ': #' . $warning['Code'] . ' ' . $warning['Message'];
        }
    }
    return $warning_messages;
}