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


PHP msql_query函数代码示例

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


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

示例1: mail_users

function mail_users($subject, $body)
{
    $query = msql_query("SELECT `email`, `first_name` FROM `users` WHERE `allow_email` = 1");
    while ($row = mysql_fetch_assoc($query) !== false) {
        email($row['email'], $subject, "Hello" . $row['first_name'] . ",\n\n" . $body);
    }
}
开发者ID:aaron770,项目名称:securelogin-repo,代码行数:7,代码来源:users.php

示例2: simpleQuery

 function simpleQuery($query)
 {
     $this->last_query = $query;
     $query = $this->modifyQuery($query);
     $result = @msql_query($query, $this->connection);
     if (!$result) {
         return $this->raiseError();
     }
     // Determine which queries that should return data, and which
     // should return an error code only.
     return DB::isManip($query) ? DB_OK : $result;
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:12,代码来源:msql.php

示例3: Query

 function Query($query)
 {
     $this->Debug("Query: {$query}");
     $first = $this->first_selected_row;
     $limit = $this->selected_row_limit;
     $this->first_selected_row = $this->selected_row_limit = 0;
     if (!$this->SelectDatabase()) {
         return 0;
     }
     if ($result = msql_query($query, $this->connection)) {
         if (substr(strtolower(ltrim($query)), 0, strlen("select")) == "select") {
             if ($limit > 0) {
                 $this->limits[$result] = array($first, $limit);
             }
             $this->highest_fetched_row[$result] = -1;
         }
         $this->affected_rows = msql_affected_rows($result);
     } else {
         return $this->SetError("Query", msql_error());
     }
     return $result;
 }
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:22,代码来源:metabase_msql.php

示例4: tableInfo

 /**
  * Returns information about a table or a result set
  *
  * @param object|string  $result  DB_result object from a query or a
  *                                 string containing the name of a table.
  *                                 While this also accepts a query result
  *                                 resource identifier, this behavior is
  *                                 deprecated.
  * @param int            $mode    a valid tableInfo mode
  *
  * @return array  an associative array with the information requested.
  *                 A DB_Error object on failure.
  *
  * @see DB_common::setOption()
  */
 function tableInfo($result, $mode = null)
 {
     if (is_string($result)) {
         /*
          * Probably received a table name.
          * Create a result resource identifier.
          */
         $id = @msql_query("SELECT * FROM {$result}", $this->connection);
         $got_string = true;
     } elseif (isset($result->result)) {
         /*
          * Probably received a result object.
          * Extract the result resource identifier.
          */
         $id = $result->result;
         $got_string = false;
     } else {
         /*
          * Probably received a result resource identifier.
          * Copy it.
          * Deprecated.  Here for compatibility only.
          */
         $id = $result;
         $got_string = false;
     }
     if (!is_resource($id)) {
         return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
     }
     if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
         $case_func = 'strtolower';
     } else {
         $case_func = 'strval';
     }
     $count = @msql_num_fields($id);
     $res = array();
     if ($mode) {
         $res['num_fields'] = $count;
     }
     for ($i = 0; $i < $count; $i++) {
         $tmp = @msql_fetch_field($id);
         $flags = '';
         if ($tmp->not_null) {
             $flags .= 'not_null ';
         }
         if ($tmp->unique) {
             $flags .= 'unique_key ';
         }
         $flags = trim($flags);
         $res[$i] = array('table' => $case_func($tmp->table), 'name' => $case_func($tmp->name), 'type' => $tmp->type, 'len' => msql_field_len($id, $i), 'flags' => $flags);
         if ($mode & DB_TABLEINFO_ORDER) {
             $res['order'][$res[$i]['name']] = $i;
         }
         if ($mode & DB_TABLEINFO_ORDERTABLE) {
             $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
         }
     }
     // free the result only if we were called on a table
     if ($got_string) {
         @msql_free_result($id);
     }
     return $res;
 }
开发者ID:BackupTheBerlios,项目名称:saecommerce,代码行数:77,代码来源:msql.php

示例5: sql_query

function sql_query($query, $id)
{
    global $dbtype;
    global $sql_debug;
    $sql_debug = 0;
    if ($sql_debug) {
        echo "SQL query: " . str_replace(",", ", ", $query) . "<BR>";
    }
    switch ($dbtype) {
        case "MySQL":
            $res = @mysql_query($query, $id);
            return $res;
            break;
        case "mSQL":
            $res = @msql_query($query, $id);
            return $res;
            break;
        case "postgres":
        case "postgres_local":
            $res = pg_exec($id, $query);
            $result_set = new ResultSet();
            $result_set->set_result($res);
            $result_set->set_total_rows(sql_num_rows($result_set));
            $result_set->set_fetched_rows(0);
            return $result_set;
            break;
        case "ODBC":
        case "ODBC_Adabas":
            $res = @odbc_exec($id, $query);
            return $res;
            break;
        case "Interbase":
            $res = @ibase_query($id, $query);
            return $res;
            break;
        case "Sybase":
            $res = @sybase_query($query, $id);
            return $res;
            break;
        default:
            break;
    }
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:43,代码来源:sql_layer.php

示例6: query_msql

 function query_msql($query)
 {
     if (!$this->msql_link) {
         return false;
     }
     $this->query_result = msql_query($query, $this->msql_link);
     if ($this->query_result) {
         return $this->query_result;
     } else {
         print nl2br("Error query. \n");
         return false;
     }
 }
开发者ID:laiello,项目名称:cartonbank,代码行数:13,代码来源:phpMM_V_23_08_2007.php

示例7: GetAllWikiPageNames

function GetAllWikiPageNames($dbi_)
{
    $res = msql_query("select pagename from wiki", $dbi['dbc']);
    $rows = msql_num_rows($res);
    for ($i = 0; $i < $rows; $i++) {
        $pages[$i] = msql_result($res, $i, 'pagename');
    }
    return $pages;
}
开发者ID:BackupTheBerlios,项目名称:oralux,代码行数:9,代码来源:msql.php

示例8: mysql_query

            <input type="submit" name="submit" value="上传" />
        </form>

        <?php 
$email = $_SESSION['p_email'];
$ret = mysql_query("SELECT * FROM Images WHERE email = '{$email}'");
if ($row = mysql_fetch_array($ret)) {
    ?>
        
        <div style='width:170px;'>
            <img src="image.php?" width="500" height="500" border="0">
        </div>
        <?php 
} else {
    $_SESSION['p_email'] = 'default';
    $ret = msql_query("SELECT * FROM Images WHERE email='default'");
    while ($row = mysql_fetch_array($ret)) {
        ?>
        
            <div style='width:170px;'>
                <img src="image.php?" width="500" height="500" border="0">
            </div>     
        <?php 
    }
}
?>
    
    </div>
   
    <div id="username"></div>
   
开发者ID:OSU-CS290,项目名称:Final_Project,代码行数:30,代码来源:account.php

示例9: mysql_real_escape_string

Password:<input type=password name='pass'><br/>
<input type=submit value='Go!' name='submit'>
</form>
<?php 
if (isset($_POST['submit'])) {
    //mysql_real_escape_string() escapes special characters in a string for use in an SQL statement
    $user = mysql_real_escape_string($_POST['user']);
    $pass = mysql_real_escape_string($_POST['pass']);
    $con = mysql_connect('localhost', 'root', '') or die(mysql_error());
    mysql_select_db('user') or die("cannot select DB");
    $query = mysql_query("SELECT * FROM login WHERE user='" . $user . "'");
    $numrows = mysql_num_rows($query);
    if ($numrows == 0) {
        //md5() calculates the MD5 hash of a string
        $encrypt_password = md5($pass);
        $sql - "INSERT INTO login(user,pass) VALUES ('{$user}','{$encrypt_password}')";
        $result = msql_query($sql);
        if ($result != 1) {
            echo "Failure!";
        } else {
            echo "Account succefully created";
        }
    } else {
        echo "That username already exists! please try again with another name.";
    }
}
?>
<p><a herf="register.php"><Register</a> | <a href="../../../Users/VANZ/AppData/Roaming/Macromedia/Dreamweaver 8/Configuration/Temp/FlashElements/ImageViewer/login.php">Login</a></p>
</body>
</html>
开发者ID:vanskevin,项目名称:vanz,代码行数:30,代码来源:register.php


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