• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_error_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_error_message函数的典型用法代码示例。如果您正苦于以下问题:PHP get_error_message函数的具体用法?PHP get_error_message怎么用?PHP get_error_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_error_message函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: handle_error_no_exit

                $smarty->assign("ErrorMessage", $error_message);
                $smarty->display('error_page.tpl');
            }
        }
    } else {
        handle_error_no_exit('productions.code: ' . mysql_error());
        $smarty->display('main.tpl');
        $error_message = get_error_message();
        $smarty->assign("ErrorMessage", $error_message);
        $smarty->display('error_page.tpl');
    }
    mysql_close($dbh);
} else {
    handle_error_no_exit('productions.code: I cannot connect to the database because: ' . mysql_error());
    $smarty->display('main.tpl');
    $error_message = get_error_message();
    $smarty->assign("ErrorMessage", $error_message);
    $smarty->display('error_page.tpl');
}
$smarty->display('footer.tpl');
function BuildEventKeywordList($categoryID, $eventName, $eventTypeID, $eventID)
{
    switch ($eventTypeID) {
        case 3:
            if ($eventID == 162) {
                $keywords = "chicagocubs, chicagocubs.com, chicagocubs com, chicago cubs com, chicagocub, cubs.com, cubs com";
            } else {
                $keywords = BuildSportsKeywordList($categoryID, $eventName);
            }
            break;
        case 4:
开发者ID:jassenm,项目名称:mongotickets_php,代码行数:31,代码来源:productions.new.php


示例2: resolve_ambiguous_event

function resolve_ambiguous_event($smarty, $cats, $sanEventName)
{
    $categoryInfo = fixup_url($smarty, $cats);
    $query = "SELECT EventID, EventName, CategoryID FROM Events WHERE SanitizedEventName='" . $sanEventName . "' AND " . "CategoryID=" . $categoryInfo['categoryID'];
    if ($query_result = mysql_query($query)) {
        $num_rows = mysql_num_rows($query_result);
        if ($num_rows == 1) {
            $table_row = mysql_fetch_row($query_result);
            $eventDetails['eventID'] = $table_row[0];
            $eventDetails['eventName'] = $table_row[1];
            $eventDetails['categoryID'] = $table_row[2];
        }
        ## put redirect or something here
    } else {
        # 5xx status code
        header('HTTP/1.0 500 Internal Server Error');
        handle_error_no_exit('ticket_dispatch.code: resolve_ambiguous_event query failed: ' . mysql_error());
        $error_message = get_error_message();
        $smarty->assign("ErrorMessage", $error_message);
        $smarty->display('main.tpl');
        $smarty->display('error_page.tpl');
    }
    return $eventDetails;
}
开发者ID:jassenm,项目名称:mongotickets_php,代码行数:24,代码来源:main_dispatch.php


示例3: array

}
echo PHP_EOL . PHP_EOL;
echo '> Checking Symfony requirements:' . PHP_EOL . '  ';
$messages = array();
foreach ($symfonyRequirements->getRequirements() as $req) {
    /** @var $req Requirement */
    if ($helpText = get_error_message($req, $lineSize)) {
        echo_style('red', 'E');
        $messages['error'][] = $helpText;
    } else {
        echo_style('green', '.');
    }
}
$checkPassed = empty($messages['error']);
foreach ($symfonyRequirements->getRecommendations() as $req) {
    if ($helpText = get_error_message($req, $lineSize)) {
        echo_style('yellow', 'W');
        $messages['warning'][] = $helpText;
    } else {
        echo_style('green', '.');
    }
}
if ($checkPassed) {
    echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects');
} else {
    echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects');
    echo_title('Fix the following mandatory requirements', 'red');
    foreach ($messages['error'] as $helpText) {
        echo ' * ' . $helpText . PHP_EOL;
    }
}
开发者ID:Dren-x,项目名称:mobit,代码行数:31,代码来源:check.php


示例4: array

							  </span>
							<?php 
$password = array('name' => 'passwordfield', 'value' => "", 'class' => 'text-center form-control', 'placeholder' => 'Password');
echo form_password($password);
?>
							<span class=" input-group-btn form-field-clear-btn-group" id="password-field-clear-btn-group" >
								<button disabled data-target="password" id="password-field-clear-btn"  class="form-field-clear-btn btn  btn-default" type="button">
									<i class="fa fa-times text-danger"></i> 
								</button>
							 </span>
						</div>
						<span id="passwordfield-help-block"  class="margin-bottom-0  padding-left-50 <?php 
echo has_message("passwordfield") ? "" : "sr-only";
?>
 help-block"> <i class="  fa fa-exclamation-circle"></i> <span id="passwordfield-message"><?php 
echo has_message("passwordfield") ? get_error_message("passwordfield") : "";
?>
</span></span>
						
					</div>
					<hr class="margin-top-0 margin-left-15  margin-right-15">
					<div class="row margin-top-10">
						<div class="col-sm-5 col-sm-offset-1">
							<div class="form-group">
								<button  type="submit" name = "loginbtn" id="loginformsubmitbtn"  class = " btn btn-default btn-md form-control input-md">
									<i class="fa fa-sign-in"></i> Sign in
								</button>
							</div>
						</div>
						<div class="col-sm-5">
							<div class="form-group">
开发者ID:shemehs,项目名称:shine19395,代码行数:31,代码来源:content.php


示例5: list_all_venues

function list_all_venues($smarty)
{
    $query = "SELECT SanitizedRegionCode, RegionCode FROM Venues WHERE 1 GROUP BY RegionCode ORDER BY RegionCode ASC";
    # $query = "SELECT SanitizedRegionCode, RegionCode FROM Productions LEFT JOIN Venues on (Productions.VenueID = Venues.VenueID) WHERE 1 GROUP BY RegionCode ORDER BY RegionCode ASC";
    if ($query_result = mysql_query($query)) {
        while ($table_row = mysql_fetch_row($query_result)) {
            $sanitizedRegionCode = $table_row[0];
            $regionCode = $table_row[1];
            $url = "/venues/{$sanitizedRegionCode}/";
            $states[] = array("name" => "{$regionCode}", "url" => "{$url}");
        }
        $title = "Find All Venues";
        $smarty->assign("title", $title);
        $keywords = "find all Venues, find all venue tickets";
        $smarty->assign("SeoKeywords", $keywords);
        $smarty->assign("MetaDescr", "All Venues. Select a venue to find and buy event Tickets at MongoTickets.");
        $smarty->display('main.tpl');
        $breadcrumb_str = '<a href="/">Home</a>';
        $breadcrumb_str = AppendBreadcrumb($breadcrumb_str, '/venues/', 'Venues');
        $smarty->assign("Breadcrumbs", $breadcrumb_str);
        $smarty->assign("h1", 'Choose a Region');
        if (count($states) > 0) {
            $smarty->assign("States", $states);
            $smarty->assign("NumStates", count($states));
            $smarty->display('all_venues.tpl');
        } else {
            echo "<div id=\"content\">";
            echo "<div id=\"breadcrumb_trail\">{$breadcrumb_str}</div>";
            echo "<div id=\"no_tickets\">";
            echo "<h1>All Venues</h1>";
            echo "<p>There are no venues</p>";
            echo "</div>";
        }
    } else {
        # 5xx status code
        header('HTTP/1.0 500 Internal Server Error');
        handle_error_no_exit('venues.code:list_venues_in_state(): I cannot connect to the database because: ' . mysql_error());
        $error_message = get_error_message();
        $smarty->assign("ErrorMessage", $error_message);
        $smarty->display('main.tpl');
        $smarty->display('error_page.tpl');
    }
}
开发者ID:jassenm,项目名称:mongotickets_php,代码行数:43,代码来源:venues.new_urls.php


示例6: mysql_query

} else {
    $query = "SELECT\n      g.*,\n      u1.username AS player_one,\n      u2.username AS player_two,\n      g.player_one as player_one_id,\n      g.player_two as player_two_id,\n      s1.user_id as user_one_id,\n      s2.user_id as user_two_id\n    FROM games g\n    INNER JOIN submissions s1 ON g.player_one = s1.submission_id\n    INNER JOIN users u1 ON s1.user_id = u1.user_id\n    INNER JOIN submissions s2 ON g.player_two = s2.submission_id\n    INNER JOIN users u2 ON s2.user_id = u2.user_id\n    WHERE g.game_id = {$game_id}";
    $result = mysql_query($query);
    if (!$result || mysql_num_rows($result) == 0) {
        $query = str_replace("FROM games g", "FROM games_archive g", $query);
        $result = mysql_query($query);
    }
    if (!$result) {
        echo "Could not query the database.\n";
    } else {
        $row = mysql_fetch_assoc($result);
        if ($playback_string = get_playback($game_id)) {
            $row['playback_string'] = $playback_string;
            $row['using_compression'] = true;
        }
        if ($error_message = get_error_message($game_id)) {
            $row['error_message'] = $error_message;
        }
        if ($row) {
            foreach ($row as $key => $value) {
                echo "{$key}={$value}\n";
            }
        }
    }
}
function get_playback($game_id)
{
    $sql = "SELECT * from playback where game_id = {$game_id}";
    $q = mysql_query($sql);
    $result = mysql_fetch_assoc($q);
    if ($result['playback_string'] != '') {
开发者ID:SavanVaghela,项目名称:ai-contest,代码行数:31,代码来源:game_info.php


示例7: function

$app->configureMode('production', function () use($app) {
    error_reporting(0);
    $app->notFound(function () use($app) {
        $page = new ErrorController(404);
        $page->render();
    });
    $app->error(function (Exception $e) use($app) {
        $app->response()->status(500);
        if (!$app->request()->isAjax()) {
            $page = new ErrorController(500);
            $page->render();
        }
        $app->stop();
        if (file_exists(BASE_DIR . '/.gbemail')) {
            foreach (explode('\\n', file_get_contents(BASE_DIR . '/.gbemail')) as $email) {
                mail(trim($email), "GetchaBooks Error", get_error_message($e));
            }
        }
    });
});
$app->hook('slim.before', function () use($app) {
    global $referrers;
    $request = $app->request();
    define('BASE_URL', $request->getUrl() . $request->getRootUri() . '/');
    define('CURRENT_URL', $request->getUrl() . $request->getPath());
    define('MOBILE_DEVICE', strpos(strtolower($request->getUserAgent()), 'mobile') !== false);
    // remove extra slashes
    $path = $request->getPath();
    $newPath = preg_replace("#/{2,}#", '/', $path);
    if ($path != $newPath) {
        $app->redirect($request->getUrl() . $newPath, 301);
开发者ID:therealchiko,项目名称:getchabooks,代码行数:31,代码来源:index.php


示例8: write_response_file_error

function write_response_file_error($error)
{
    $jsonResponse = new stdClass();
    $jsonResponse->backupStatus = 'error';
    $jsonResponse->backupMessage = get_error_message($error);
    write_response_file($jsonResponse);
}
开发者ID:ajspencer,项目名称:NCSSM-SG-WordPress,代码行数:7,代码来源:job_backup.php


示例9: fwp_multiundelete_page

function fwp_multiundelete_page()
{
    // If this is a POST, validate source and user credentials
    FeedWordPressCompatibility::validate_http_request('feedwordpress_feeds', 'manage_links');
    $link_ids = isset($_REQUEST['link_ids']) ? $_REQUEST['link_ids'] : array();
    if (isset($_REQUEST['link_id'])) {
        array_push($link_ids, $_REQUEST['link_id']);
    }
    if (isset($GLOBALS['fwp_post']['confirm']) and $GLOBALS['fwp_post']['confirm'] == 'Undelete') {
        if (isset($GLOBALS['fwp_post']['link_action']) and is_array($GLOBALS['fwp_post']['link_action'])) {
            $actions = $GLOBALS['fwp_post']['link_action'];
        } else {
            $actions = array();
        }
        $do_it = array('unhide' => array());
        foreach ($actions as $link_id => $what) {
            $do_it[$what][] = $link_id;
        }
        $links = array();
        if (count($do_it['unhide']) > 0) {
            $links = get_bookmarks(array('include' => implode(', ', $do_it['unhide']), 'hide_invisible' => 0));
        }
        $errs = $success = array();
        foreach ($links as $linkdata) {
            $linkdata->link_visible = 'Y';
            $result = wp_update_link((array) $linkdata);
            if (is_wp_error($result)) {
                $errs[] = get_error_message('db_update_error');
            } else {
                $success[] = 'resubscribing post: ' . $linkdata->link_id;
            }
        }
        if (count($success) > 0) {
            echo "<div class=\"updated\">\n";
            if (count($errs) > 0) {
                echo "There were some problems processing your ";
                echo "re-subscribe request. [SQL: " . implode('; ', $errs) . "]";
            } else {
                echo "Your re-subscribe request(s) have been processed.";
            }
            echo "</div>\n";
        }
        return true;
        // Continue on to Syndicated Sites listing
    } else {
        $targets = array();
        if (is_array($link_ids) && count($link_ids) > 1) {
            $targets = get_bookmarks(array('include' => implode(',', $link_ids), 'hide_invisible' => 0));
        } else {
            if (count($link_ids) == 1) {
                $targets[] = get_bookmark(array_shift($link_ids));
            }
        }
        ?>
<form action="admin.php?page=<?php 
        echo FWP_SYNDICATION_PAGE_SLUG;
        ?>
&visibility=Y" method="post">
<div class="wrap">
<?php 
        FeedWordPressCompatibility::stamp_nonce('feedwordpress_feeds');
        ?>
<input type="hidden" name="action" value="<?php 
        print FWP_RESUB_CHECKED;
        ?>
" />
<input type="hidden" name="confirm" value="Undelete" />

<h2>Re-subscribe to Syndicated Links:</h2>
<?php 
        foreach ($targets as $cur_link) {
            $subscribed = 'Y' == strtoupper($cur_link->link_visible);
            $link_url = esc_html($cur_link->link_url);
            $link_name = esc_html($cur_link->link_name);
            $link_description = esc_html($cur_link->link_description);
            $link_rss = esc_html($cur_link->link_rss);
            if (!$subscribed) {
                ?>
<fieldset>
<legend><?php 
                echo $link_name;
                ?>
</legend>
<table class="editform" width="100%" cellspacing="2" cellpadding="5">
<tr><th scope="row" width="20%"><?php 
                _e('Feed URI:');
                ?>
</th>
<td width="80%"><a href="<?php 
                echo $link_rss;
                ?>
"><?php 
                echo $link_rss;
                ?>
</a></td></tr>
<tr><th scope="row" width="20%"><?php 
                _e('Short description:');
                ?>
</th>
<td width="80%"><?php 
//.........这里部分代码省略.........
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:101,代码来源:syndication.php


示例10: update_field

 /**
  * Update a custom field post
  *
  * @param
  *
  * @return
  */
 function update_field()
 {
     // Retrieve the existing settings for the field so we can compare
     $existing = get_post($_POST['custom_field_id']);
     if (!$existing) {
         if (MDJM_DEBUG == true) {
             MDJM()->debug->log_it('Unable to update field with ID: ' . $_GET['id'] . '. May not exist', true);
         }
         wp_redirect(mdjm_get_admin_page('custom_event_fields') . '&message=5');
         exit;
     }
     $id = wp_update_post(array('ID' => $_POST['custom_field_id'], 'post_title' => wp_strip_all_tags($_POST['field_label']), 'post_content' => !empty($_POST['field_desc']) ? $_POST['field_desc'] : '', 'post_name' => sanitize_title($_POST['field_label']), 'post_status' => 'publish'), true);
     /**
      * Success
      * We can now add the meta data
      */
     if (!empty($id)) {
         if (MDJM_DEBUG == true) {
             MDJM()->debug->log_it('Custom field updated ' . $_POST['field_label'], true);
         }
         foreach ($_POST as $key => $value) {
             if (substr($key, 0, 5) != '_mdjm') {
                 continue;
             }
             // Add the meta data to the post
             update_post_meta($id, $key, $value);
         }
         wp_redirect(mdjm_get_admin_page('custom_event_fields') . '&message=2');
         exit;
     } else {
         if (MDJM_DEBUG == true && is_wp_error($id)) {
             MDJM()->debug->log_it('Unable to create custom field ' . $_POST['field_label'] . '. ' . get_error_message(), true);
         }
         wp_redirect(mdjm_get_admin_page('custom_event_fields') . '&message=4');
         exit;
     }
 }
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:44,代码来源:event-fields.php


示例11: validates_format_of

 public function validates_format_of($prop, $format, $message = false)
 {
     if ($prop === false) {
         $this->validate_format_of = array();
     } else {
         if (!is_array($prop)) {
             $prop = array($prop);
         }
         foreach ($prop as $k => $p) {
             # add the error message if there isn't one
             $message = $message ? $message : get_error_message(VALIDATION_FORMAT, $p);
             $this->validate_format_of[strtolower($p)] = array($format, $message);
         }
     }
 }
开发者ID:brysonian,项目名称:Saint,代码行数:15,代码来源:DBRecordValidator.php


示例12: elseif

} elseif (empty($tables[$token_data['table']])) {
    $error = error("Token error. Table \"{$token_data['table']}\" is not defined");
} else {
    $errors = cw_call('cw_can_edit_on_place', array($token_data), array());
}
if (!empty($token_data['pk'])) {
    $pk_fields = cw_query("SHOW KEYS FROM {$tables[$token_data['table']]} WHERE Key_name = 'PRIMARY'");
    if (count($pk_fields) > 1) {
        $error = error('Token error. Primary key is specified, but table has multicolumn primary key. Use "where" instead');
    }
    if (count($pk_fields) == 0) {
        $error = error('Token error. Primary key is specified, but table has no primary key. Use "where" instead');
    }
}
if (is_error()) {
    cw_add_top_message(get_error_message(), 'E');
    return $error;
}
$where = array();
if (!empty($token_data['pk'])) {
    $where[] = $pk_fields[0]['Column_name'] . ' = ' . $token_data['pk'];
}
if (!empty($token_data['where'])) {
    $where[] = $token_data['where'];
}
$cw_tokens[$request_prepared['token']]['old_value'] = cw_query_first_cell($q = "SELECT {$token_data['field']} FROM {$tables[$token_data['table']]} WHERE " . join(' AND ', $where));
cw_array2update($token_data['table'], array($token_data['field'] => $request_prepared['value']), join(' AND ', $where));
cw_add_top_message("Data has been saved successfully");
if ($token_data['handler']) {
    cw_call($token_data['handler'], array($token_data, $request_prepared['value']));
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:31,代码来源:edit_on_place.php



注:本文中的get_error_message函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_error_msg函数代码示例发布时间:2022-05-15
下一篇:
PHP get_error函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap