本文整理汇总了PHP中mysqlConnection::getConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqlConnection::getConnection方法的具体用法?PHP mysqlConnection::getConnection怎么用?PHP mysqlConnection::getConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysqlConnection
的用法示例。
在下文中一共展示了mysqlConnection::getConnection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getmanfullrevall
function getmanfullrevall($manid)
{
//printf('manid: '.$manid.'');
//$cloud = mysql_query("SELECT man_id, title_orig, genre, notes, stat_id, per_id, datesubmitted FROM tbl_manuscript WHERE man_id=$manid") or die(mysql_error());
$query = "SELECT man_id, title_orig, genre, notes, stat_id, per_id, datesubmitted FROM tbl_manuscript WHERE man_id={$manid} ORDER by dateSubmitted ASC";
if (!($res = mysqlConnection::getConnection()->query($query))) {
die('There was an error running the query [' . $query->error . ']');
}
$num_rows = $res->num_rows;
if ($num_rows < 1) {
printf("You do not have any active reviews currently assigned.<br /> See the left hand menu for your options.");
} else {
// $arr = mysql_fetch_assoc($cloud);
$arr = $res->fetch_assoc();
$title = $arr['title_orig'];
$genre = $arr['genre'];
$notes = $arr['notes'];
$statid = $arr['stat_id'];
$submitted = $arr['datesubmitted'];
$perid = $arr['per_id'];
$author = authname($perid);
printf('
<div id="review" style="border-top:1px solid #ccc;">
<table>
<tr><td style="width:105px">Manuscript ref:</td><td>#' . $arr['man_id'] . '  <a href="reviewmanuscript.php?manid=' . $arr['man_id'] . '">My Review</a></td></tr>
<tr><td>Author:</td><td>' . $author . '</td></tr>
<tr><td>Title:</td><td>' . $title . '</td></tr>
<tr><td>Genre:</td><td>' . $genre . '</td></tr>
<tr><td>Notes:</td><td>' . $notes . '</td></tr>');
getstatus($arr['stat_id']);
printf('<tr><td>Date submitted:</td><td>' . $submitted . '</td></tr>
</table></div>');
}
}
示例2: header
<?php
header('Content-Type: application/json');
$rest_json = file_get_contents("php://input");
$_POST = json_decode($rest_json, true);
$_POST = parse_str($rest_json, $parameters);
$aResult = array();
include './model/mysqlConnection.php';
if ($parameters['arguments']['0'] == null) {
echo 'Wrong Parameters';
die;
// die('Wrong Parameters');
}
$query = "UPDATE tbl_people SET notify = 'No' where per_id = {$parameters['arguments']['0']}";
if (!($res = mysqlConnection::getConnection()->query($query))) {
die('There was an error running the query [' . $query->error . ']');
}
echo json_encode(array('id' => 3));
?>
示例3: json_encode
}
// Check if $uploadOk is set to 0 by an error
// if everything is ok, try to upload file
if (move_uploaded_file($_FILES["uploadedFile"]["tmp_name"], $target_file)) {
// echo "The file ". basename( $_FILES["uploadedFile"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
echo json_encode(array('errorMsg' => 'Sorry, there was an error uploading your file.'));
die;
}
$uploadedFile = file_get_contents($target_file);
$uploadedFile = addslashes($uploadedFile);
$currentTime = date("Y-m-d H:i:s");
$query = "insert into tbl_manuscript(per_id,stat_id,dateSubmitted, dateStatus, title_orig, genre,notes ) values('{$per_id}','1','{$currentTime}','{$currentTime}','{$title}','{$category}','{$notes}')";
if (!($res = mysqlConnection::getConnection()->query($query))) {
die('There was an error running the query [' . $query->error . ']');
}
$result = mysqlConnection::getConnection()->insert_id;
// echo $result;
$query = "insert into tbl_doc(doc_size,doc_filename,doc_date, full_partial, doc_type, man_id) values('{$fileSize}','{$fileName}','{$currentTime}','F','{$_FILES['uploadedFile']['type']}','{$result}')";
if (!($res = mysqlConnection::getConnection()->query($query))) {
die('There was an error running the query [' . $query->error . ']');
}
if ($res) {
echo json_encode(array('id' => mysqlConnection::getConnection()->insert_id));
} else {
echo json_encode(array('errorMsg' => 'Some errors occured.'));
}
} catch (RuntimeException $e) {
echo $e->getMessage();
}