本文整理匯總了PHP中PMA_DBI_get_warnings函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_DBI_get_warnings函數的具體用法?PHP PMA_DBI_get_warnings怎麽用?PHP PMA_DBI_get_warnings使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PMA_DBI_get_warnings函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PMA_getWarningMessages
/**
* 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;
}
示例2: PMA_DBI_insert_id
}
$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);
}
示例3: PMA_getWarningMessagesArray
/**
* 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;
}