當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sql_query::get_data方法代碼示例

本文整理匯總了PHP中sql_query::get_data方法的典型用法代碼示例。如果您正苦於以下問題:PHP sql_query::get_data方法的具體用法?PHP sql_query::get_data怎麽用?PHP sql_query::get_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sql_query的用法示例。


在下文中一共展示了sql_query::get_data方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

         //keep query string
         $bolShowLogin = 0;
         //By default this is one until someone logs in.
         $dbconn = mysql_connect($db_hst, $db_un, $db_pw) or die($msg_conn_err . " {$db_hst}, {$db_un}, {$db_pw}");
         mysql_select_db($db) or die($db_err);
         $result = mysql_query("UPDATE {$db_tbl_name_sessions} SET {$db_col_name_sessions_sid_time} = UNIX_TIMESTAMP() WHERE {$db_col_name_sessions_sid} = {$sid};");
         mysql_close($dbconn);
     }
 } elseif (isset($_POST[$form_pw])) {
     $pw = clean_string_for_db($_POST[$form_pw], $MAX_PASSWORD_LENGTH);
     $obj = new sql_string($db_tbl_name_members);
     $obj->set_db_col_aliases(array($db_col_name_member_pw));
     $obj->set_db_where($db_col_name_member_pw . " = '" . $pw . "'");
     $str_SQL = $obj->get_SQL();
     $obj = new sql_query($db_hst, $db_un, $db_pw, $db, $str_SQL);
     $ary_data = $obj->get_data();
     if ($ary_data == 0) {
         print "Invalid Password<br>";
     } else {
         //Delete old entries in tblSessions
         $dbconn = mysql_connect($db_hst, $db_un, $db_pw) or die($msg_conn_err . " {$db_hst}, {$db_un}, {$db_pw}");
         mysql_select_db($db) or die($db_err);
         $result = mysql_query("DELETE FROM {$db_tbl_name_sessions} WHERE UNIX_TIMESTAMP() - {$db_col_name_sessions_sid_time} > {$MAX_UPDATE_SESSION_TIME};");
         //Create sid
         $sid = rand(1000, 9999) . date("j") . rand(1000, 9999);
         //Insert sid into table
         $result = mysql_query("INSERT INTO {$db_tbl_name_sessions} SET {$db_col_name_sessions_sid} = {$sid}, {$db_col_name_sessions_sid_time} = UNIX_TIMESTAMP();");
         if ($result == 0) {
             print "error insert<br>";
         } else {
             $qs = $qs . $db_col_name_member_sid . "=" . $sid;
開發者ID:imupmyass,項目名稱:imupmyass.github.io,代碼行數:31,代碼來源:site_processing.php


注:本文中的sql_query::get_data方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。