本文整理汇总了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);
}
}
}
}
示例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 />";
}
}
示例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'];
}
}
示例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>";
}
}
示例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;
}
示例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>";
}
}
示例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;
}
示例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']);
}
}
示例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();
}
示例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 />";
}
}
示例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;
}
示例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>";
}
}
示例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;
}
示例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>";
}
}
示例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;
}
}
}