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

PHP updateDB函数代码示例

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

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



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

示例1: uploadImg

function uploadImg()
{
    echo "<pre>";
    print_r($_FILES);
    print_r($_REQUEST['name']);
    echo "</pre>";
    $unlink_file = $_REQUEST['name'];
    $img_name = str_replace(".jpg", ".png", $unlink_file);
    //Borra la imagen original..
    if (unlink($unlink_file)) {
        echo "Imagen original eliminada correctamente..";
        //Sube al servidor la imagen modificada..
        if (move_uploaded_file($_FILES['file']['tmp_name'], "./" . $img_name)) {
            //Actualiza DB..
            if (updateDB($img_name)) {
                echo "DB modifiada con exito..";
            } else {
                echo "No se pudo actualizar la DB..";
            }
        } else {
            echo "Fallo la subida..";
        }
    } else {
        echo "No se pudo borrar la imagen original..";
    }
    /*
    	define('UPLOAD_DIR', 'img/');
    	$img = $_POST['img'];
    	$img = str_replace('data:image/png;base64,', '', $img);
    	$img = str_replace(' ', '+', $img);
    	$data = base64_decode($img);
    	$file = UPLOAD_DIR . uniqid() . '.png';
    	$success = file_put_contents($file, $data);
    	print $success ? $file : 'Unable to save the file.';
    */
}
开发者ID:Astronico,项目名称:ImagePanel,代码行数:36,代码来源:imagepanel.php


示例2: save

function save($action)
{
    global $dbn, $action;
    #return 'action = ' . $action;
    if (isset($_POST['memberSelect'])) {
        $id = $_POST['memberSelect'];
    } else {
        if (!isset($_POST['uname']) or !isset($_POST['pword']) or !isset($_POST['pwordConfirm'])) {
            return 'You left something out!';
        }
        $id = $_POST['id'];
        $uname = $_POST['uname'];
        $pword1 = $_POST['pword'];
        $pword2 = $_POST['pwordConfirm'];
        $pword = md5($pword1);
        if ($action != 'Delete' and $pword1 != $pword2) {
            return 'The passwords don\'t match!';
        }
    }
    switch ($action) {
        case 'Add':
            $ip = $_SERVER['REMOTE_HOST'];
            $sql = "insert into myprogramo (id, uname, pword, lastip, lastlogin) values (null, '{$uname}', '{$pword}','{$ip}', CURRENT_TIMESTAMP);";
            $out = "Account for {$uname} successfully added!";
            break;
        case 'Delete':
            $action = 'Add';
            $sql = "DELETE FROM `{$dbn}`.`myprogramo` WHERE `myprogramo`.`id` = {$id} LIMIT 1";
            $out = "Account for {$uname} successfully deleted!";
            break;
        case 'Edit':
            $action = 'Add';
            $sql = "update myprogramo set uname = '{$uname}', pword = '{$pword}' where id = {$id};";
            $out = "Account for {$uname} successfully updated!";
            break;
        default:
            $action = 'Edit';
            $sql = '';
            $out = '';
    }
    $x = !empty($sql) ? updateDB($sql) : '';
    #return "action = $action<br />\n SQL = $sql";
    return $out;
}
开发者ID:massyao,项目名称:chatbot,代码行数:44,代码来源:members.php


示例3: SQLite3

// какие валюты запрошены
$currencyBase = $_REQUEST['b'];
// какая - базовая
$dtTo = $_REQUEST['to'];
// только конец диапазона, потому что вынимаем всегда на год назад
// если базовая не рубль, мы её принудительно включим в перечень запрошенных, если её там нет, чтобы данные по ней вытащить из источника и/или базы
if ($currencyBase != 'RUB') {
    if (array_search($currencyBase, $currencies) === false) {
        $currencies[] = $currencyBase;
    }
}
// инициализация базы
$db = new SQLite3('rates.db');
initDB($db);
// обновляем базу по запрошенному перечню и дате конца периода
updateDB($db, $currencies, $dtTo);
// готовим ответ, обращаясь уже к базе
// здесь будем вынимать данные, заполнять пустые даты, приводить курсы к базовой валюте, пересчитывая по рублю
$res['data'] = prepareResponse($db, $currencies, $currencyBase, $dtTo);
// отправляем приложению
header('Access-Control-Allow-Origin: *');
header('Content-type: application/json');
echo json_encode($res);
// ------------------------------------------------
// готовим данные
function prepareResponse($db, $currencies, $currencyBase, $dtTo)
{
    $res = array();
    // для каждой валюты в запросе
    foreach ($currencies as $currency) {
        if ($currency == 'RUB') {
开发者ID:kityan,项目名称:demoSavingsCalc,代码行数:31,代码来源:index.php


示例4: step07_dealSQL

 function step07_dealSQL()
 {
     // $this->closeSite();
     $filePath = $targetDir = DATA_PATH . '/update/download/unzip/updateDB.php';
     if (!file_exists($filePath)) {
         // 如果本次升级没有数据库的更新,直接返回
         echo 1;
         exit;
     }
     require_once $filePath;
     updateDB();
     unlink($filePath);
     // 数据库验证
     $filePath = $targetDir = DATA_PATH . '/update/download/unzip/checkDB.php';
     if (!file_exists($filePath)) {
         // 如果本次升级没有数据库的更新后的验证代码,直接返回
         echo 1;
         exit;
     }
     require_once $filePath;
     // checkDB方法正常返回1 否则返回异常的说明信息,如:ts_xxx数据表创建不成功
     checkDB();
     unlink($filePath);
     echo 1;
 }
开发者ID:noikiy,项目名称:weiphp,代码行数:25,代码来源:UpdateController.class.php


示例5: mysql_get_rows

$is_exists = mysql_get_rows('user_completed_couse', array('where' => "section_id='{$section_id}' AND user_id='{$user_id}'"), 1);
if ($is_exists === '') {
    $section_data = mysql_get_rows('course_sections', array('where' => "id='{$section_id}'"), 1);
    $insert_values = array('user_id' => $user_id, 'course_id' => $section_data['course_id'], 'section_id' => $section_id);
    $id = insertDB($insert_values, 'user_completed_couse');
    $completed = array();
} else {
    $id = $is_exists['id'];
    if (trim($is_exists['completed']) === '') {
        $completed = array();
    } else {
        $completed = explode(',', trim($is_exists['completed']));
    }
}
if ($enable == 1) {
    $completed[] = $step_id;
    array_unique($completed);
    $str_completed = implode(',', $completed);
    updateDB("completed = '{$str_completed}'", "WHERE id='{$id}'", 'user_completed_couse');
    $return_data['status'] = 1;
    $return_data['enable'] = 1;
} else {
    $completed = array_diff($completed, array($step_id));
    array_unique($completed);
    $str_completed = implode(',', $completed);
    updateDB("completed = '{$str_completed}'", "WHERE id='{$id}'", 'user_completed_couse');
    $return_data['status'] = 1;
    $return_data['enable'] = 0;
}
echo json_encode($return_data);
exit;
开发者ID:ArpanTanna,项目名称:outsourceplatform,代码行数:31,代码来源:stepenable.php


示例6: elseif

    if ($name == 'email') {
        $email = $value;
        // XXX do stripslashes() here and below?
    } elseif ($name == 'rationale') {
        $rationale = $value;
    } elseif ($value == 'TBW' || $value == 'WIP' || $value == 'SCS' || $value == 'none') {
        // Ignore any other values, including empty values.
        $status[addslashes($name)] = $value;
    }
}
// Ensure that email and rationale were provided
if ($email == '' || !Email::isValidEmail($email) || $rationale == '' || !isUTF8($rationale) || mb_strlen($rationale) > 125) {
    getMissingInfo($email, $rationale, $status);
} else {
    if ($_SERVER['PATH_INFO'] == '/confirm') {
        updateDB($email, $rationale, $status);
        outputConfirmed();
    } else {
        $body = getMailConfirmRequest($email, $rationale, $status);
        $sig = "HTML5 Status Updates\nhttp://www.whatwg.org/html5";
        $mail = new Email();
        $mail->setSubject("HTML5 Status Update");
        $mail->addRecipient('To', '[email protected]', 'Lachlan Hunt');
        $mail->setFrom("[email protected]", "WHATWG");
        $mail->setSignature($sig);
        $mail->setText($body);
        $mail->send();
        outputConfirmation($body, $sig);
    }
}
function getMissingInfo($email, $rationale, $status)
开发者ID:CaseyLeask,项目名称:developers.whatwg.org,代码行数:31,代码来源:update-markers.php


示例7: array

    }
    if (!empty($_POST['lastname'])) {
        $lastname_edit = $_POST['lastname'];
        $input_cols[] = "lastname";
        $input_adds[] = $lastname_edit;
        $valid = true;
    }
    if (!empty($_POST['birthdate'])) {
        $birthdate_edit = $_POST['birthdate'];
        $input_cols[] = "birthdate";
        $input_adds[] = $birthdate_edit;
        $valid = true;
    }
    $edit_input = array($input_cols, $input_adds);
    if ($valid) {
        updateDB("users", $edit_input, array("id", $user_id));
    }
}
?>

<form id='form_users_edit' action="" method="post">
    <?php 
echo "<table id='table_users' border cellpadding='5px'> \n            <tr style='color:red; font-weight:bold; text-align:center; '>\n            <td style='padding:10px;'>Username</td>\n            <td style='padding:10px;''>Email</td>\n            <td style='padding:10px;''>Password</td>\n            <td style='padding:10px;''>First Name</td>\n            <td style='padding:10px;''>Last Name</td>\n            <td style='padding:10px;''>BirthDate</td>\n            <td style='padding:10px;''>O</td>\n            </tr>";
$sql = select("users", array("id", "username", "email", "password", "firstname", "lastname", "birthdate"));
echo 'Number of Affected Rows : ' . count(mysqli_fetch_array($sql));
while ($rows = mysqli_fetch_array($sql)) {
    echo "<tr><td>" . $rows['username'] . "</td>";
    echo "<td>" . $rows['email'] . "</td>";
    echo "<td>" . $rows['password'] . "</td>";
    echo "<td>" . $rows['firstname'] . "</td>";
    echo "<td>" . $rows['lastname'] . "</td>";
开发者ID:vontman,项目名称:new_mvc_github,代码行数:31,代码来源:users.php


示例8: ob_flush

     $result->close();
     $mysqli->commit();
     echo "<li>Updating standard_setting values in the properties table</li>\n";
     ob_flush();
     flush();
     // Call the standard_setting list page to populate the results in std_set table.
     $result = $mysqli->prepare("SELECT DISTINCT property_id, total_mark FROM properties WHERE marking LIKE '2,%'");
     $result->execute();
     $result->store_result();
     $result->bind_result($property_id, $total_mark);
     while ($result->fetch()) {
         $no_reviews = 0;
         $reviews = get_reviews($mysqli, 'index', $property_id, $total_mark, $no_reviews);
         foreach ($reviews as $review) {
             if ($review['method'] != 'Hofstee') {
                 updateDB($review, $mysqli);
             }
         }
     }
     $result->close();
 }
 // 04/07/2013 (cczsa1) - enhanced question type config
 $new_lines = array("\n// Enhanced Calculation question config\n", "\$enhancedcalculation = array('host' => 'localhost', 'port'=>6311,'timeout'=>5); //default enhancedcalc Rserve config options\n", "//but use phpEval as default for enhanced calculation questions\n", "\$enhancedcalc_type = 'phpEval'; //set the enhanced calculation to use php for maths \n", "\$enhancedcalculation = array(); //no config options for phpEval enhancedcalc plugin");
 $target_line = '$cfg_password_expire';
 $updater_utils->add_line($string, '$enhancedcalculation', $new_lines, 80, $cfg_web_root, $target_line, 1);
 // 04/07/2013 (cczsa1) - add new field to logs to indicate an error state
 if (!$updater_utils->does_column_exist('log0', 'errorstate')) {
     $updater_utils->execute_query("ALTER TABLE log0 ADD COLUMN errorstate tinyint unsigned NOT NULL DEFAULT '0' AFTER user_answer", true);
 }
 if (!$updater_utils->does_column_exist('log0_deleted', 'errorstate')) {
     $updater_utils->execute_query("ALTER TABLE log0_deleted ADD COLUMN errorstate tinyint unsigned NOT NULL DEFAULT '0' AFTER user_answer", true);
开发者ID:vinod-co,项目名称:centa,代码行数:31,代码来源:version5.php


示例9: egive_egv

            if ($doUpdate) {
                $sSQL = "INSERT INTO egive_egv (egv_egiveID, egv_famID, egv_DateEntered, egv_EnteredBy) VALUES ('" . $egiveID . "','" . $famID . "','" . date("YmdHis") . "','" . $_SESSION['iUserID'] . "');";
                RunQuery($sSQL);
            }
            foreach ($giftDataMissingEgiveID as $data) {
                $fields = explode('|', $data);
                if ($fields[2] == $egiveID) {
                    $transId = $fields[0];
                    $date = $fields[1];
                    $name = $fields[3];
                    $amount = $fields[4];
                    $fundId = $fields[5];
                    $comment = $fields[6];
                    $frequency = $fields[7];
                    $groupKey = $fields[8];
                    updateDB($famID, $transId, $date, $name, $amount, $fundId, $comment, $frequency, $groupKey);
                }
            }
        } else {
            ++$importError;
        }
    }
    $_SESSION['giftDataMissingEgiveID'] = $giftDataMissingEgiveID;
    $_SESSION['egiveID2NameWithUnderscores'] = $egiveID2NameWithUnderscores;
    importDoneFixOrContinue();
} else {
    ?>
	<table cellpadding="3" align="left">
	<tr><td>
		<form method="post" action="eGive.php?DepositSlipID=<?php 
    echo $iDepositSlipID;
开发者ID:dschwen,项目名称:CRM,代码行数:31,代码来源:eGive.php


示例10: convert

function convert($fromFile, $toFile)
{
    global $FFMPEG, $count, $REGISTERED_MEDIA_EXTENSION, $FROM_DIR, $con;
    $cmd = $FFMPEG . " -v warning -i " . escapeshellarg($fromFile) . " -map 0 -sn -vcodec libx264 -acodec libfaac " . escapeshellarg($toFile) . " -y 2>&1";
    //$cmd = $FFMPEG . " -v warning -i '" . $fromFile . "' -map 0 -sn -vcodec copy -acodec copy '" . $toFile . "' -y 2>&1";
    //$cmd = "cp '" . $fromFile . "'  '" . $toFile. "' 2>&1";
    echo $cmd . "\n";
    $exec_output = array();
    $return_var = -1;
    exec($cmd, $exec_output, $return_var);
    $path = preg_split("|/|i", $fromFile);
    if ($return_var == 0) {
        //echo $fromFile . " - Ok\n";
        $updDB = updateDB(str_replace($FROM_DIR, '', $fromFile), str_replace($FROM_DIR, '', $toFile));
        if ($updDB) {
            echo str_replace($FROM_DIR, '', $fromFile) . " updated\n";
            exec("rm -f " . escapeshellarg($fromFile));
        } else {
            echo str_replace($FROM_DIR, '', $fromFile) . " NOT UPDATED !!!!!\n";
        }
    } else {
        echo "\tError executing:\n";
        for ($i = 0; $i < sizeof($exec_output); $i++) {
            echo "\t" . $exec_output[$i] . "\n";
        }
    }
}
开发者ID:vrevyuk,项目名称:perecoder,代码行数:27,代码来源:finder.php


示例11: fclose

             }
             if (!fwrite($handle, $dump_buffer)) {
                 $keyMessage = 'ErrorWriteDump';
                 $error = 1;
             } else {
                 $keyMessage = 'WriteDumpConfirm';
             }
             fclose($handle);
         }
         //end else
         if ($error != 1) {
             $_SESSION['hostDB_old'] = $_POST['dbHost_old'];
             $_SESSION['nameDB_old'] = $_POST['dbName_old'];
             $_SESSION['userDB_old'] = $_POST['dbAdminUsername_old'];
             $_SESSION['passDB_old'] = $_POST['dbAdminPasswd_old'];
             if (!updateDB($_POST['dbHost'], $_POST['dbAdminUsername'], $_POST['dbAdminPasswd'], $_POST['dbName'], $_POST['dbHost_old'], $_POST['dbAdminUsername_old'], $_POST['dbAdminPasswd_old'], $_POST['dbName_old'])) {
                 $keyMessage = 'ErrorUpdateDb';
             } else {
                 $keyMessage = 'UpdateDb';
                 $enableUpdateImage = 1;
             }
         }
     } else {
         $error = 1;
         $keyMessage = 'WrongDbName';
     }
 } else {
     $error = 1;
     $keyMessage = 'WrongDbCredit';
 }
 break;
开发者ID:kleopatra999,项目名称:finx,代码行数:31,代码来源:Setup.php


示例12: insertDB

                 }
             }
             insertDB($insert_data[0], 'messages');
             // Start order if not started
             if ($job_type !== '') {
                 if ($job_type == 2 && $payment_data['order_started'] == 0) {
                     // TODO : change status 2 - Done
                     $order_date = date('Y-m-d H:i:s');
                     updateDB("order_started = 1, order_start_date = '{$order_date}', job_status = 2", "WHERE id = '{$payment_data['id']}'", 'payments');
                     $insert_data[1] = delivery_start_msg($payment_data['id'], $user_data['id']);
                 } elseif ($job_type == 4 && in_array($payment_data['job_status'], array(3))) {
                     updateDB("job_status = 4", "WHERE id = '{$payment_data['id']}'", 'payments');
                 } elseif ($job_type == 5 && in_array($payment_data['job_status'], array(3))) {
                     updateDB("job_status = 5", "WHERE id = '{$payment_data['id']}'", 'payments');
                 } elseif ($job_type == 6) {
                     updateDB("job_status = 6", "WHERE id = '{$payment_data['id']}'", 'payments');
                 }
             }
             $return_data['status'] = 1;
             $return_data['message'] = 'Message sent successfully';
         } else {
             $messages = '';
             foreach ($v->errors() as $k => $msgs) {
                 foreach ($msgs as $msg) {
                     $messages .= $msg . "<br>";
                 }
             }
             $return_data['message'] = $messages;
         }
     }
 }
开发者ID:ArpanTanna,项目名称:outsourceplatform,代码行数:31,代码来源:updatejob.php


示例13: parseAIML

function parseAIML($fn, $aimlContent)
{
    if (empty($aimlContent)) {
        return "File {$fn} was empty!";
    }
    global $debugmode, $bot_id, $default_charset;
    $fileName = basename($fn);
    $success = false;
    $dbconn = db_open();
    #Clear the database of the old entries
    $sql = "DELETE FROM `aiml`  WHERE `filename` = '{$fileName}' AND bot_id = '{$bot_id}'";
    if (isset($_POST['clearDB'])) {
        $x = updateDB($sql);
    }
    $myBot_id = isset($_POST['bot_id']) ? $_POST['bot_id'] : $bot_id;
    # Read new file into the XML parser
    $sql_start = "insert into `aiml` (`id`, `bot_id`, `aiml`, `pattern`, `thatpattern`, `template`, `topic`, `filename`, `php_code`) values\n";
    $sql = $sql_start;
    $sql_template = "(NULL, {$myBot_id}, '[aiml_add]', '[pattern]', '[that]', '[template]', '[topic]', '{$fileName}', ''),\n";
    # Validate the incoming document
    /*******************************************************/
    /*       Set up for validation from a common DTD       */
    /*       This will involve removing the XML and        */
    /*       AIML tags from the beginning of the file      */
    /*       and replacing them with our own tags          */
    /*******************************************************/
    $validAIMLHeader = '<?xml version="1.0" encoding="[charset]"?>
<!DOCTYPE aiml PUBLIC "-//W3C//DTD Specification Version 1.0//EN" "http://www.program-o.com/xml/aiml.dtd">
<aiml version="1.0.1" xmlns="http://alicebot.org/2001/AIML-1.0.1">';
    $validAIMLHeader = str_replace('[charset]', $default_charset, $validAIMLHeader);
    $aimlTagStart = stripos($aimlContent, '<aiml', 0);
    $aimlTagEnd = strpos($aimlContent, '>', $aimlTagStart) + 1;
    $aimlFile = $validAIMLHeader . substr($aimlContent, $aimlTagEnd);
    //die('<pre>' . htmlentities("File contents:<br />\n$aimlFile"));
    try {
        libxml_use_internal_errors(true);
        $xml = new DOMDocument();
        $xml->loadXML($aimlFile);
        //$xml->validate();
        $aiml = new SimpleXMLElement($xml->saveXML());
        $rowCount = 0;
        if (!empty($aiml->topic)) {
            foreach ($aiml->topic as $topicXML) {
                # handle any topic tag(s) in the file
                $topicAttributes = $topicXML->attributes();
                $topic = $topicAttributes['name'];
                foreach ($topicXML->category as $category) {
                    $fullCategory = $category->asXML();
                    $pattern = $category->pattern;
                    $pattern = str_replace("'", ' ', $pattern);
                    $that = $category->that;
                    $template = $category->template->asXML();
                    $template = str_replace('<template>', '', $template);
                    $template = str_replace('</template>', '', $template);
                    $aiml_add = str_replace("\r\n", '', $fullCategory);
                    # Strip CRLF from category (windows)
                    $aiml_add = str_replace("\n", '', $aiml_add);
                    # Strip LF from category (mac/*nix)
                    $sql_add = str_replace('[aiml_add]', mysql_real_escape_string($aiml_add), $sql_template);
                    $sql_add = str_replace('[pattern]', $pattern, $sql_add);
                    $sql_add = str_replace('[that]', $that, $sql_add);
                    $sql_add = str_replace('[template]', mysql_real_escape_string($template), $sql_add);
                    $sql_add = str_replace('[topic]', $topic, $sql_add);
                    $sql .= "{$sql_add}";
                    $rowCount++;
                    if ($rowCount >= 100) {
                        $rowCount = 0;
                        $sql = rtrim($sql, ",\n") . ';';
                        $success = updateDB($sql) >= 0 ? true : false;
                        $sql = $sql_start;
                    }
                }
            }
        }
        if (!empty($aiml->category)) {
            foreach ($aiml->category as $category) {
                $fullCategory = $category->asXML();
                $pattern = $category->pattern;
                $pattern = str_replace("'", ' ', $pattern);
                $that = $category->that;
                $template = $category->template->asXML();
                $template = str_replace('<template>', '', $template);
                $template = str_replace('</template>', '', $template);
                $aiml_add = str_replace("\r\n", '', $fullCategory);
                # Strip CRLF from category (windows)
                $aiml_add = str_replace("\n", '', $aiml_add);
                # Strip LF from category (mac/*nix)
                $sql_add = str_replace('[aiml_add]', mysql_real_escape_string($aiml_add), $sql_template);
                $sql_add = str_replace('[pattern]', $pattern, $sql_add);
                $sql_add = str_replace('[that]', $that, $sql_add);
                $sql_add = str_replace('[template]', mysql_real_escape_string($template), $sql_add);
                $sql_add = str_replace('[topic]', '', $sql_add);
                $sql .= "{$sql_add}";
                $rowCount++;
                if ($rowCount >= 100) {
                    $rowCount = 0;
                    $sql = rtrim($sql, ",\n") . ';';
                    $success = updateDB($sql) >= 0 ? true : false;
                    $sql = $sql_start;
                }
//.........这里部分代码省略.........
开发者ID:massyao,项目名称:chatbot,代码行数:101,代码来源:upload.php


示例14: updateDB

<pre>
<?php 
require_once "../init_database_data.php";
require_once $store_config['code'] . "stores/" . $store_config["dbms"] . "store_install.phtml";
$cache_store = $cache_config["dbms"] . "store_install";
$cachestore = new $cache_store(".", $cache_config);
function updateDB($store, $properties)
{
    foreach ($properties as $name => $property) {
        echo "\tAltering store_prop_{$name}\n";
        if ($store->has_property($name)) {
            $store->alter_property($name, $property);
        } else {
            $store->create_property($name, $property);
        }
    }
}
updateDB($store, $properties);
updateDB($cachestore, $cacheproperties);
?>
</pre>
开发者ID:poef,项目名称:ariadne,代码行数:21,代码来源:upgrade.database.php


示例15: header

<?php

header("Content-type: text/xml");
require_once 'Excel/reader.php';
//echo $numRows."<br/>";
//echo $numCols;
if (isset($_GET)) {
    $startIndex = $_GET["startIndex"];
    $endIndex = $_GET["endIndex"];
    updateDB($startIndex, $endIndex);
}
//update the products based on the Excel
function updateDB($startIndex, $endIndex)
{
    //need to copy the code that does the excel reading
    $analysisData = new Spreadsheet_Excel_Reader();
    // Set output Encoding.
    $analysisData->setOutputEncoding('CP1251');
    $inputFileName = 'ReverseGeoCodingForStopsVerification.xls';
    $analysisData->read($inputFileName);
    error_reporting(E_ALL ^ E_NOTICE);
    $numRows = $analysisData->sheets[0]['numRows'];
    $numCols = $analysisData->sheets[0]['numCols'];
    //echo $numRows.",".$numCols;
    $strRoute = '<Routes>';
    for ($i = $startIndex; $i <= $endIndex; $i++) {
        $stopId = $analysisData->sheets[0]['cells'][$i][1];
        $StopName = $analysisData->sheets[0]['cells'][$i][2];
        $Buses = $analysisData->sheets[0]['cells'][$i][3];
        $latitude = $analysisData->sheets[0]['cells'][$i][4];
        $longitude = $analysisData->sheets[0]['cells'][$i][5];
开发者ID:rohdimp24,项目名称:test,代码行数:31,代码来源:ReverseGeoCodingForStopsVerification.php


示例16: explode

    $err = explode(',', $_GET['errors']);
}
if (!empty($_GET['successes'])) {
    $succ = explode(',', $_GET['successes']);
}
$hutId = $_GET['id'];
$hutName = getHutName($hutId);
$hutDetails = fetchHutDetails($hutId);
//Fetch information specific to koie
$errors = array();
$successes = array();
if (!empty($_POST)) {
    $errors = array();
    foreach ($_POST as $id => $value) {
        if (is_numeric($id) and is_numeric($value) and isset($value)) {
            $updateDB = updateDB($id, $value);
            if (!$updateDB) {
                $errors[] = lang("DATABASE_NOT_UPDATED");
            }
        }
    }
    if (empty($errors)) {
        $successes[] = lang("DATABASE_UPDATED");
    }
}
if (!empty($_POST['nyinventar'])) {
    $navn = trim($_POST['nyinventar']);
    $verdi = $_POST['nyinventarverdi'];
    if (!empty($navn) && !empty($verdi)) {
        if (ctype_digit($verdi)) {
            $added = addInventar($navn, $hutId, $verdi);
开发者ID:CWGran,项目名称:hutwatch,代码行数:31,代码来源:admin_hut.php


示例17: switch

    }
} else {
    $mode = "index";
}
require_once 'head.php';
switch ($mode) {
    case 'index':
        viewFront();
        break;
    case 'gallery':
        viewGallery();
        break;
    case 'login':
        viewLogin();
        break;
    case 'register':
        viewRegister();
        break;
    case 'upload':
        viewUpload();
        break;
    case 'logout':
        logOut();
        break;
    case 'updateDB':
        updateDB();
        break;
    default:
        viewFront();
}
require_once 'foot.html';
开发者ID:saarmae,项目名称:VR1,代码行数:31,代码来源:controller.php


示例18: VALUES

    }
    $db->free($query);
    $dbVersion = $numRows < 1 ? MAX_DB_VERSION : $newestVersionFound;
    // if $dbVersion is 0, updateVersion0 will create the table in question instead
    if ($dbVersion > 0 && $numRows < 1) {
        $db->SQL('INSERT INTO `misc_data` (`db.Version`) VALUES (' . $dbVersion . ')');
    } elseif ($dbVersion > 0 && $numRows > 1) {
        $db->SQL('DELETE FROM `misc_data`');
        $db->SQL('INSERT INTO `misc_data` (`db.Version`) VALUES (' . $dbVersion . ')');
    }
}
// call the updating code now that we know the current db version
// use a while loop instead of iterating inside the update function
// so we keep the used stack memory low
while ($dbVersion < MAX_DB_VERSION) {
    updateDB($dbVersion);
}
echo 'The used database (' . $config->getValue('dbName') . ') is up to date (version ' . $dbVersion . ').' . "\n";
exit;
function status($message = '')
{
    echo $message . "\n";
}
function updateDB(&$version)
{
    global $config;
    echo 'Database (' . $config->getValue('dbName') . ') is at version ' . $version . "\n";
    if ($version < MAX_DB_VERSION) {
        echo 'Updating...' . "\n";
        $updateVersionFunction = 'updateVersion' . $version;
        $updateWorked = $updateVersionFunction();
开发者ID:laiello,项目名称:bz-owl,代码行数:31,代码来源:bz-owl-db-updater.php


示例19: PrintText

    PrintText("\n\nCategory ID: {$cat_id}\n=====================================");
    $sph->multiInit(getOptions());
    $stop_after = 31;
    // $count = 1;
    // foreach($category as $one_title){
    for ($cat = 0; $cat < sizeof($category); $cat++) {
        $one_title = $category[$cat];
        PrintText("{$cat}: {$one_title}");
        $sph->setOptions(getOptions());
        $sph->setAttribute('what', 'jobs');
        $sph->setAttribute('lposition', $one_title);
        $sph->addQuery();
        if ($cat % $stop_after == 0 && $cat != 0) {
            getSPHresutls($sph, &$ids, $cat_id);
            // PrintText("\n-------\nafter function ids:\n");
            // var_dump($ids);
            updateDB($ids, $cat_id);
            unset($ids);
            $ids = NULL;
        }
        // $count++;
    }
    getSPHresutls($sph, &$ids, $cat_id);
    updateDB($ids, $cat_id);
    unset($ids);
    $ids = NULL;
    // PrintText("\n-------\nafter function ids:\n");
    // var_dump($ids);
}
PrintText("\nEND:\n");
var_dump($ids);
开发者ID:sergrin,项目名称:crawlers-il,代码行数:31,代码来源:jobs_categories.php


示例20: secure_data

    if ($attachment_update == 1) {
        $attachment = secure_data($_POST['attachment']);
        $insert_data['attachment'] = $attachment;
        if ($attachment) {
            $src = UPLOAD_ROOT . 'temp/' . $attachment;
            $des = UPLOAD_ROOT . 'attachment/' . $attachment;
            rename($src, $des);
        }
    }
    $insert_data['sender_id'] = $_SESSION['agent'];
    $insert_data['msg_type'] = 1;
    $insert_data['payment_id'] = secure_data($_POST['pi']);
    // Insert
    insertDB($insert_data, 'messages');
    // Update
    updateDB("info_updated = '1'", 'WHERE id = ' . $insert_data['payment_id'], 'payments');
    ob_start();
    include "info_display.php";
    $html = ob_get_contents();
    ob_end_clean();
    $return_data['html'] = $html;
    $return_data['status'] = 1;
    $return_data['message'] = 'Info updated successfully';
} else {
    $messages = '';
    foreach ($v->errors() as $k => $msgs) {
        foreach ($msgs as $msg) {
            $messages .= $msg . "<br>";
        }
    }
    $return_data['message'] = $messages;
开发者ID:ArpanTanna,项目名称:outsourceplatform,代码行数:31,代码来源:updateinfo.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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