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


PHP MySQL::QueryArray方法代码示例

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


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

示例1: login

 public function login($data)
 {
     $db = new MySQL(true, 'color64', 'localhost', 'color64', 'nu5Jc4JdtZK4RCHH');
     $sql = 'SELECT * FROM `users` WHERE `id` = "' . $data['u'] . '" AND `password` = "' . MD5($data['p']) . '";';
     $result = $db->QueryArray($sql);
     return $result;
 }
开发者ID:vlhorton,项目名称:color64,代码行数:7,代码来源:members.php

示例2: dumpTableData

 function dumpTableData($table)
 {
     $conn = new MySQL(true, DBNAME, DBHOST, DBUSER, DBPASS, "", true);
     $strTables = "SELECT * FROM `{$table}`";
     $conn->QueryArray($strTables);
     $cntTables = $conn->RowCount();
     if ($cntTables) {
         $num_fields = $conn->GetColumnCount($table);
         $this->output .= "\n\n";
         $this->output .= "-- \n";
         $this->output .= "-- Dumping data for table `{$table}` \n";
         $this->output .= "-- \n\n";
         $fields = '';
         $field_type = array();
         $i = 0;
         while ($i < $num_fields) {
             if (!$fields) {
                 $fields = "`" . $conn->GetColumnName($i, $table) . "`";
             } else {
                 $fields .= ", " . "`" . $conn->GetColumnName($i, $table) . "`";
             }
             //                array_push($field_type, $conn->GetColumnDataType($i, $table));
             $i++;
         }
         $conn->MoveFirst();
         while (!$conn->EndOfSeek()) {
             $rsTable = $conn->RowArray();
             $this->output .= "INSERT INTO `{$table}` ({$fields}) VALUES (";
             for ($i = 0; $i < $num_fields; $i++) {
                 if (is_null($rsTable[$i])) {
                     $this->output .= "null";
                 } else {
                     switch ($field_type[$i]) {
                         case 'int':
                             $this->output .= $rsTable[$i];
                             break;
                         case 'string':
                         case 'blob':
                         default:
                             $this->output .= "'" . addslashes($rsTable[$i]) . "'";
                             break;
                     }
                 }
                 if ($i < $num_fields - 1) {
                     $this->output .= ", ";
                 }
             }
             $this->output .= ");\n";
         }
     }
     $this->output .= "\n";
 }
开发者ID:aliihaidar,项目名称:pso,代码行数:52,代码来源:backup.class.php

示例3: MySQL

<?php

ini_set("display_errors", 0);
include "./classes/mysql.class.php";
if ($_GET['pid'] == "") {
    echo "enter pid in url";
    exit;
} else {
    $reqparam = $_GET['pid'];
}
$db = new MySQL();
$db->Open();
$sql1 = "SELECT p.name,  DATE_FORMAT(p.age,'%d-%b-%Y') as dob, floor((((YEAR(NOW()) - YEAR(p.age)))*12 + (((MONTH(NOW()) - MONTH(p.age)))))/12) as age, place FROM person p where p.personid = '" . $reqparam . "'";
$row1 = $db->QueryArray($sql1);
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />  
<meta name="viewport" content="width=360, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,target-densitydpi=device-dpi, user-scalable=no">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title><?php 
echo $row1[0][0];
?>
 - Filmography</title>

<!-- / END -->
开发者ID:filmyjo,项目名称:FJMDb-Dev,代码行数:30,代码来源:printp.php

示例4: header

    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
        header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
    }
    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
        header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
    }
}
include "mysql.class.php";
$database = new MySQL();
global $database;
if (!isset($_GET["parametro"])) {
    if ($database->Query("SELECT\n                                    kiiconnect_setting.nombre,\n                                    kiiconnect_setting.tag,\n                                    kiiconnect_setting.descripcion,\n                                    kiiconnect_setting.icono,\n                                    kiiconnect_setting.link,\n                                    kiiconnect_categoria.nombre AS categoria,\n                                    kiiconnect_categoria.id AS id_categoria,\n                                    kiiconnect_categoria.filecategoria,\n                                    kiiconnect_categoria.filecategoria2,\n                                    kiiconnect_categoria.icono AS categoria_icono\n                                FROM\n                                    kiiconnect_setting\n                                INNER JOIN kiiconnect_categoria ON kiiconnect_setting.id_categoria = kiiconnect_categoria.id\n                                WHERE\n                                    activo = 1\n                                ORDER BY\n                                    orden ASC")) {
        echo $database->GetJSON();
    } else {
        echo "<p>Query Failed</p>";
    }
} else {
    $temp = $database->QueryArray("SELECT\n                                    kiiconnect_categoria.nombre AS categoria,\n                                    kiiconnect_categoria.id AS id_categoria,\n                                    kiiconnect_categoria.iconodev AS categoria_icono,\n                                    kiiconnect_categoria.filecategoriadev AS filecategoria\n                                FROM\n                                    kiiconnect_categoria\n                                WHERE\n                                  activo = 1\n                                ORDER BY orden2", MYSQL_ASSOC);
    $temp2 = array();
    foreach ($temp as $index => $categoria) {
        $categoria_id = $categoria['id_categoria'];
        //            CONCAT('" . '<span style="font-weight:bold">' ." ', kiiconnect_setting.nombre, '</span>') AS nombre,
        $itemsCategoria = $database->QueryArray("SELECT\n                                    kiiconnect_setting.nombre,\n                                    kiiconnect_setting.tag,\n                                    kiiconnect_setting.descripcion,\n                                    kiiconnect_setting.icono,\n                                    kiiconnect_setting.file,\n                                    kiiconnect_setting.link\n                                FROM\n                                    kiiconnect_setting\n                                 WHERE\n                                    activo = 1 AND id_categoria = {$categoria_id}\n                                ORDER BY\n                                    orden ASC", MYSQL_ASSOC);
        if ($itemsCategoria != false) {
            $categoria['items'] = $itemsCategoria;
            $temp2[] = $categoria;
        }
    }
    $temp3 = json_encode($temp2);
    echo $temp3;
}
开发者ID:byronmisiva,项目名称:msv-dev,代码行数:31,代码来源:crudKiiconnectjsondev.php

示例5: queryAll

 /**
  * Return all rows for the given sql query.
  *
  * @param string $query the sql query to execute
  * @return array
  */
 public function queryAll($query)
 {
     return $this->conn->QueryArray($query);
 }
开发者ID:kimai,项目名称:kimai,代码行数:10,代码来源:Mysql.php

示例6: die

//uid
//prodcode
//descr
//model
//category
//url
//price
//trade
//stocklevel
//updated
//onorder
//webready
//supplier
//brand
$sql = "SELECT * from import_hkstock";
$gethk = $db->QueryArray($sql);
$new_id = $db->InsertRow("webstock", $insert);
if (!$new_id) {
    //print_r ($insert);
    die('Unable to write record to DB.');
}
unset($insert);
echo '</table>';
//echo('<input type="submit" name="submit" value="submit" />');
echo '</form>';
echo '<br><h4>Finished, you may close this page, </h4></body>';
// If there were no errors...
// Commit the transaction and save these records to the database
if ($db->TransactionEnd()) {
    $db->Kill();
    $db->Release();
开发者ID:onyxnz,项目名称:quartzpos,代码行数:31,代码来源:update.php

示例7: MySQL

<?php

ini_set("display_errors", 0);
include "./classes/mysql.class.php";
if ($_GET['y'] == "") {
    $reqparam = "2015";
} else {
    $reqparam = $_GET['y'];
}
$db = new MySQL();
$db->Open();
$sql7 = "SELECT  count(*) as cnt FROM movie m;";
$row7 = $db->QueryArray($sql7);
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />  
<meta name="viewport" content="width=360, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,target-densitydpi=device-dpi, user-scalable=no">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title><?php 
echo $reqparam;
?>
 - Year in Film</title>
<link href="css/helper.css" media="screen" rel="stylesheet" type="text/css" />

<!-- Beginning of compulsory code below -->
开发者ID:filmyjo,项目名称:FJMDb-Dev,代码行数:30,代码来源:yearsmob.php


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