当前位置: 首页>>代码示例>>PHP>>正文


PHP sql_db::sql_error方法代码示例

本文整理汇总了PHP中sql_db::sql_error方法的典型用法代码示例。如果您正苦于以下问题:PHP sql_db::sql_error方法的具体用法?PHP sql_db::sql_error怎么用?PHP sql_db::sql_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sql_db的用法示例。


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

示例1:

 if ($upgrade != 1) {
     if ($dbms != 'msaccess') {
         // Load in the sql parser
         include $phpbb_root_path . 'includes/sql_parse.' . $phpEx;
         // Ok we have the db info go ahead and read in the relevant schema
         // and work on building the table.. probably ought to provide some
         // kind of feedback to the user as we are working here in order
         // to let them know we are actually doing something.
         $sql_query = @fread(@fopen($dbms_schema, 'r'), @filesize($dbms_schema));
         $sql_query = preg_replace('/phpbb_/', $table_prefix, $sql_query);
         $sql_query = $remove_remarks($sql_query);
         $sql_query = split_sql_file($sql_query, $delimiter);
         for ($i = 0; $i < sizeof($sql_query); $i++) {
             if (trim($sql_query[$i]) != '') {
                 if (!($result = $db->sql_query($sql_query[$i]))) {
                     $error = $db->sql_error();
                     page_header($lang['Install'], '');
                     page_error($lang['Installer_Error'], $lang['Install_db_error'] . '<br />' . $error['message']);
                     page_footer();
                     exit;
                 }
             }
         }
         // Ok tables have been built, let's fill in the basic information
         $sql_query = @fread(@fopen($dbms_basic, 'r'), @filesize($dbms_basic));
         $sql_query = preg_replace('/phpbb_/', $table_prefix, $sql_query);
         $sql_query = $remove_remarks($sql_query);
         $sql_query = split_sql_file($sql_query, $delimiter_basic);
         for ($i = 0; $i < sizeof($sql_query); $i++) {
             if (trim($sql_query[$i]) != '') {
                 if (!($result = $db->sql_query($sql_query[$i]))) {
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:31,代码来源:install.php

示例2: values

<?
include( 'mysql4.php' );
include( '../config.php' );

//first we need to retrieve the list of all active companies that might have imported data
$db_support = new sql_db( $supportdb, $dbuser, $dbpasswd, 'nizex_support', false );

if ( $db_support->db_connect_id )
	{
	$query	= "select CompanyID, DBName, DBHost, TableVersion from optUserCompany where Active=1 ";
		
	if ( !( $result = $db_support->sql_query( $query ) ) )
		{	
		$lbl_error = $dblang[ "ErrorInSQL" ]."<br>".$db_support->sql_error();
		}
	
	while ( $row = $db_support->sql_fetchrow( $result ))
		{		
		$db = new sql_db( $dbhost, $dbuser, $dbpasswd, $row[ 'DBName' ], true );

		$query = "select * from conLeadSources where LeadName='Other'";
		if ( !( $result2 = $db->sql_query( $query ) ) )
			echo "Problem with: ".$query;

		if ( $db->sql_numrows( $result2 ) == 0 )
			{
			$query = "insert into conLeadSources values ( null, 'Other', 1 )";
			if ( !( $result2 = $db->sql_query( $query ) ) )
				echo "Problem with: ".$query;
			}
		} //end while looping through companies	 
开发者ID:rhancock1223,项目名称:merxphp,代码行数:31,代码来源:test.php

示例3: die

echo("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n");
echo("<meta name=\"author\" content=\"Icy Phoenix Team\" />\n");
echo("<title>Icy Phoenix :: UTF-8 Conversion</title>\n");
echo("</head>\n");
echo("<body>\n");
echo("<div style=\"font-family: 'Lucida Grande', 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; font-size: 10px;\">\n");
echo("<b style=\"color: #dd2222;\">DB Conversion to UTF-8 in progress, please do not stop the browser until the whole process is finished...</b><br />\n<br />\n<br />\n");
// HTML HEADER - END
flush();

$sql = "ALTER DATABASE {$db->sql_escape($dbname)}
	CHARACTER SET utf8
	DEFAULT CHARACTER SET utf8
	COLLATE utf8_bin
	DEFAULT COLLATE utf8_bin";
$db->sql_query($sql) or die($db->sql_error());

$sql = "SHOW TABLES";
$result = $db->sql_query($sql) or die($db->sql_error());
while ($row = $db->sql_fetchrow($result))
{
	// This assignment doesn't work...
	//$table = $row[0];

	$current_item = each($row);
	$table = $current_item['value'];
	reset($row);

	if (strpos($table, $table_prefix) === 0)
	{
		$sql = "ALTER TABLE {$db->sql_escape($table)}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:convert_utf8.php

示例4: getDBHost

function getDBHost( $databasename = '' )
{
global $supportdb, $dbuser, $dbpasswd;
$dbsupport = new sql_db( $supportdb, $dbuser, $dbpasswd, 'nizex_support', false, true );

$query	= "select DBHost from optUserCompany where DBName = '".$databasename."'";

if ( !$result = $dbsupport->sql_query( $query ) )
	{
	LogError( 9369, $query ."<br>".$dbsupport->sql_error(), false );
	return false;
	}

$row = $dbsupport->sql_fetchrow( $result );
return $row[ "DBHost" ];
}
开发者ID:rhancock1223,项目名称:merxphp,代码行数:16,代码来源:general_functions-bak.php


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