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


PHP queryMysql函数代码示例

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


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

示例1: createCounter

 /**
  * @param \Printer $printer
  */
 function createCounter(Printer $printer)
 {
     $this->printerID = $printer->id;
     $this->oldCounter = $printer->currentCount;
     $this->pageCost = $printer->pageCost;
     if ($this->newCounter < $this->oldCounter) {
         echo "Этот счетчик меньше уже введенного для этого принтера. Проверяйте внимательно<br><br>";
         require_once "footer.php";
         die;
     }
     if (!isset($this->connection)) {
         $this->getConnection();
     }
     $result = queryMysql("SELECT * FROM ig_printers WHERE PRINTER_PCOUNT='{$this->newCounter}'");
     if ($result->num_rows) {
         echo "Этот счетчик уже введен для этого принтера. Проверяйте внимательно<br><br>";
         require_once "footer.php";
         die;
     } else {
         $query = "INSERT INTO ig_counters (PRINTER_ID, DATE_UPDATE, OLD_COUNTER, NEW_COUNTER, PAGE_COST) VALUES ('{$this->printerID}','{$this->date}','{$this->oldCounter}','{$this->newCounter}','{$this->pageCost}')";
         $result = $this->connection->query($query);
         if (!$result) {
             die($this->connection->error);
         } else {
             $query = "UPDATE ig_printers SET PRINTER_PCOUNT='{$this->newCounter}',DATE_PRINTER_LAST_EDIT='{$this->date}' WHERE PRINTER_NUMBER= '{$this->printerID}'";
             $result = $this->connection->query($query);
             if (!$result) {
                 die($this->connection->error);
             }
         }
     }
 }
开发者ID:Karmadon,项目名称:Printers,代码行数:35,代码来源:Counter.php

示例2: showProfile

function showProfile($user)
{
    if (file_exists("pics/cover/{$user}.jpg") == null && file_exists("pics/profile/{$user}.jpg") == null) {
        echo "<br/><br/><div align='left'  style='background-image:url(bg2.png) ;border:thick ridge rgba(78, 154, 163, 0.7);margin-right:40%;width:75%;height:480px;'";
        echo "<p><h2 style='margin-left:12%;margin-top:50px;color:white;font-family:segoe print;'>Upload Your's  & a Cover Photo To give a look to Your Profile ";
        echo "<br/><br/>Access to Your <a class='button grey' href='rnprofile.php'>Profile Page</a> And Edit Your Info....!!</h2></p><br/><br/><br/> ";
        echo " <img src='pics/p-photo.png'   style='margin-left:20%;margin-top:55px;width:180px;height:200px;border:thin ridge;'/></div><br/>";
    } elseif (file_exists("pics/cover/{$user}.jpg") == null || file_exists("pics/profile/{$user}.jpg") == null) {
        if (file_exists("pics/cover/{$user}.jpg") == null) {
            echo "<br/><br/><div align='left'  style='background-image:url(bg2.png)  ;border:thick ridge rgba(78, 154, 163, 0.7);margin-right:40%;width:75%;'";
            echo "<p><h2 style='margin-left:12%;margin-top:50px;color:white;font-family:segoe print;'>Upload a Cover Photo To give a look to Your Profile ";
            echo " <br/><br/>Access to Your <a class='button grey' href='rnprofile.php'>Profile Page</a> And Edit Your Info....!!</h2></p>";
            echo "<img src='pics/profile/{$user}.jpg'   style='margin-left:20%;margin-top:120px;width:180;height:228;border:thin ridge;'/> ";
            echo " </div><br/>";
        } elseif (file_exists("pics/profile/{$user}.jpg") == null) {
            echo "<br/><br/><div align='left'  style='background-image:url(pics/cover/{$user}.jpg)  ;border:thick ridge rgba(78, 154, 163, 0.7);margin-right:40%;width:75%;'";
            echo "<p><h2 style='margin-left:12%;margin-top:50px;color:white;font-family:segoe print;'>Upload Your Photo To give a look to Your Profile ";
            echo "<br/><br/>Access to Your <a class='button grey' href='rnprofile.php'>Profile Page</a> And Edit Your Info....!!</h2></p><br/><br/><br/> ";
            echo " <img src='pics/p-photo.png'   style='margin-left:20%;margin-top:120px;width:180;height:228;border:thin ridge;'/></div><br/>";
        }
    } else {
        echo "<div align='left'  ><img align='left' src='pics/cover/{$user}.jpg' style='width:900;height:500;border:thick ridge rgba(78, 154, 163, 0.7);'/>  ";
        echo "<img src='pics/profile/{$user}.jpg' align='left'  style='margin-left:20%;margin-top:-217px;width:190;height:210;border:thin ridge;'/> ";
        echo " </div><hr style='margin-top: 0.5px;margin-left:0px;width:75%;'/><br/> ";
    }
    echo "<fieldset class='outer' style='background-image:url(son.png);'><em style='margin-left:1%;'><b class='button black'> ";
    echo ucwords(" {$user} </b></em><b class='ud3btn'>Said : </b><font style='font-size:28px;color:rgb(66, 123, 140);'><b style='font-size:24px;height:40px;' class='button black'>");
    $result = queryMysql("SELECT * FROM rnprofiles WHERE user='{$user}'");
    if (mysql_num_rows($result)) {
        $row = mysql_fetch_row($result);
        echo stripslashes($row[1]) . "</b></font></fieldset><br clear=left /><br/><hr />";
    }
}
开发者ID:klewasps,项目名称:velvet,代码行数:33,代码来源:rnfunctions.php

示例3: showProfile

function showProfile($username)
{
    $result = queryMysql("SELECT * FROM Users where username='{$username}'");
    if ($result->num_rows) {
        $row = $result->fetch_array(MYSQLI_ASSOC);
        echo $row['username'];
    }
}
开发者ID:WebApps4u,项目名称:cs157AOnlineBanking,代码行数:8,代码来源:functions.php

示例4: showProfile

/**
 * @param $user
 */
function showProfile($user)
{
    $result = queryMysql("SELECT * FROM ig_users WHERE username='{$user}'");
    if ($result->num_rows) {
        $row = $result->fetch_array(MYSQLI_ASSOC);
        echo stripslashes($row['text']) . "<br style='clear:left;'><br>";
    }
}
开发者ID:Karmadon,项目名称:Printers,代码行数:11,代码来源:functions.php

示例5: getUsers

function getUsers()
{
    $query = "SELECT username FROM USERS ORDER BY username ASC";
    $result = queryMysql($query);
    $output = '';
    while ($row = $result->fetch_assoc()) {
        $output = $output . '<tr> <td>' . $row['username'] . '</td>' . '<td> <form name="Remove ' . $row['username'] . '" class="form-horizontal" method="POST" action="./remove_user.php">' . '<input type="button" value="Remove ' . $row['username'] . '" class="btn btn-primary btn-xs btn-block" id="remove_user"> </td>' . '<input type="hidden" class="form-control" name="username" value="' . $row['username'] . '" id="username">' . '</form>' . '</tr>';
    }
    return $output;
}
开发者ID:wnazaire,项目名称:intro-to-internet-computing,代码行数:10,代码来源:dashboard.php

示例6: showProfile

function showProfile($user)
{
    if (file_exists("{$user}.jpg")) {
        echo "<img src='{$user}.jpg' style='float:left;'>";
    }
    $result = queryMysql("SELECT * FROM profiles WHERE user='{$user}'");
    if ($result->num_rows) {
        $row = $result->fetch_array(MYSQLI_ASSOC);
        echo stripslashes($row['text']) . "<br style='clear:left;'><br>";
    }
}
开发者ID:hackertron,项目名称:CryptSteg,代码行数:11,代码来源:functions.php

示例7: showUserStory

function showUserStory($conn, $view)
{
    $query = "SELECT text FROM profiles WHERE user='{$view}'";
    $result = queryMysql($conn, $query);
    if ($result->num_rows) {
        $text = $result->fetch_array(MYSQLI_ASSOC)['text'];
    } else {
        $text = '';
    }
    return $text;
}
开发者ID:OlZyuzin,项目名称:Simple-Social-Network,代码行数:11,代码来源:functions.php

示例8: showProfile

function showProfile($user)
{
    // if (file_exists("user_images/$user.jpg"))
    //     echo "<img src = 'user_images/$user.jpg' alt='profile pic' class='profilePic' />";
    $result = queryMysql("SELECT * FROM profiles WHERE user='{$user}'");
    if ($result->num_rows) {
        $row = $result->fetch_array(MYSQLI_ASSOC);
        echo "<div class = 'mainText'> <p>";
        echo stripslashes($row['text']);
    }
}
开发者ID:ni554n,项目名称:xpress,代码行数:11,代码来源:functions.php

示例9: check_user

function check_user($field)
{
    //check whether input username exists
    $result = queryMysql("SELECT username FROM members WHERE username='{$field}'");
    if ($result->num_rows) {
        return "This username is taken";
    } else {
        return "";
    }
    $result->close();
}
开发者ID:Kulbear,项目名称:quiz-fun-project,代码行数:11,代码来源:signup.php

示例10: showProfile

function showProfile($user)
{
    if (file_exists("{$user}.jpg")) {
        echo "<img src='{$user}.jpg' border='1' align='left'/>";
    }
    $result = queryMysql("SELECT * FROM rnprofiles WHERE user='{$user}'");
    if (mysql_num_rows($result)) {
        $row = mysql_fetch_row($result);
        echo stripslashes($row[1]) . "<br clear=left /><br />";
    }
}
开发者ID:jimmyc815,项目名称:algo,代码行数:11,代码来源:dbfunction.php

示例11: turtle_portfolio_value

function turtle_portfolio_value($portfolioID)
{
    $my_sql = "select sum(a.shares * b.last_price) from turtle_portfolio a, detail_quote b where a.portfolio_id = " . $portfolioID . " and a.symbol = b.symbol and a.symbol != 'CASH' ";
    $my_sql .= "union ";
    $my_sql .= "select shares from turtle_portfolio where symbol = 'CASH' and portfolio_id = " . $portfolioID;
    //print "my sql: $my_sql \n";
    $result = queryMysql($my_sql);
    while ($data = mysql_fetch_row($result)) {
        $value += $data[0] * 1 / 1;
    }
    return $value;
}
开发者ID:jimmyc815,项目名称:algo,代码行数:12,代码来源:turtle_share_module.php

示例12: showProfile

function showProfile($user)
{
    if (file_exists("{$user}.jpg")) {
        echo "<img src='{$user}.jpg' align='center' />";
    }
    $result = queryMysql("SELECT * FROM user WHERE username='{$user}'");
    if (mysql_num_rows($result)) {
        $row = mysql_fetch_row($result);
        echo "<br><h3>";
        echo stripslashes($row[1]) . " " . stripslashes($row[2]) . "<br clear=left /><br/></h3>";
    }
}
开发者ID:rohitchawla22,项目名称:Brain-Spark,代码行数:12,代码来源:functions.php

示例13: getComments

function getComments($id)
{
    $query = "SELECT TIME_STAMP, COMMENT_TEXT, USER FROM COMMENTS WHERE POST_ID='{$id}'";
    $output = "";
    $result = queryMysql($query);
    if ($result->num_rows) {
        while ($row = $result->fetch_assoc()) {
            $comment_text = $row['COMMENT_TEXT'];
            $output = $output . '<hr><h4><strong>' . $row['USER'] . '</strong> said, </h4>' . '<p>"' . unescapeSpecialCharacters($comment_text) . '"</p>' . getRelTime($row['TIME_STAMP']);
        }
    }
    return $output;
}
开发者ID:wnazaire,项目名称:intro-to-internet-computing,代码行数:13,代码来源:comments.php

示例14: showProfile

function showProfile($user)
{
    global $home_url;
    $pic_url = $home_url . "/uploads/{$user}.jpg";
    $pic_path = __DIR__ . "/uploads/{$user}.jpg";
    if (file_exists($pic_path)) {
        echo "<img src='{$pic_url}' style='float:left;'>";
    }
    $result = queryMysql("SELECT * FROM profiles WHERE user='{$user}'");
    if ($result->num_rows) {
        $row = $result->fetch_array(MYSQLI_ASSOC);
        echo stripslashes($row['text']) . "<br style='clear:left;'><br>";
    }
}
开发者ID:MicBosi,项目名称:Parrot,代码行数:14,代码来源:functions.php

示例15: dologinWithPostData

 private function dologinWithPostData()
 {
     //check login form contents
     if (empty($_POST['user']) || $_POST['pass']) {
         $this->errors[] = "Not all fields were entered";
     } elseif (!empty($_POST['user_name']) && !empty($_POST['user_password'])) {
         $user = sanitizeString($_POST['user']);
         $pass = sanitizeString($_POST['pass']);
         $query = "SELECT user,pass FROM members\n            WHERE user='{$user}' AND pass='{$pass}'";
         //if this user exists
         if (mysql_num_rows(queryMysql($query)) == 1) {
             $_SESSION['user'] = $user;
             $_SESSION['pass'] = $pass;
         }
     }
 }
开发者ID:hyun13,项目名称:practice_web,代码行数:16,代码来源:Login.php


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