本文整理汇总了PHP中pg_errormessage函数的典型用法代码示例。如果您正苦于以下问题:PHP pg_errormessage函数的具体用法?PHP pg_errormessage怎么用?PHP pg_errormessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pg_errormessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_provider_data
function get_provider_data($provider_id)
{
$qry = pg_query_params("select sp_home_page, contactemail from techmatcher.serviceprovider where serviceprovider_id=\$1", array($provider_id)) or die(pg_errormessage());
$result = pg_fetch_assoc($qry);
$_SESSION['provider']['contactemail'] = $result['contactemail'];
return $result["sp_home_page"];
}
示例2: Delete
/**
* Удалить код активации
*
* @param integer $fid ID Пользователя, у которого удаляем код активации
* @return string Сообщение об ошибке
*/
function Delete($fid)
{
global $DB;
$sql = "DELETE FROM activate_mail WHERE user_id = ?";
$DB->query($sql, $fid);
return pg_errormessage();
}
示例3: executeQuery
public function executeQuery($sql)
{
//prepare query
$sql = $this->prepareQuery($sql);
$parts = explode(" ", trim($sql));
$type = strtolower($parts[0]);
$hash = md5($sql);
$this->lastHash = $hash;
if ($type == "select") {
if (isset($this->results[$hash])) {
if (is_resource($this->results[$hash])) {
return $this->results[$hash];
}
}
} else {
if ("update" == $type || "delete" == $type) {
$this->results = array();
//clear the result cache
}
}
$query = pg_query($this->connection, $sql);
if (!$query) {
echo pg_errormessage($this->connection);
}
$this->results[$hash] = $query;
return $this->results[$hash];
}
示例4: query
public function query($string = '')
{
if ($string != '') {
$this->query = $this->escape($string);
} else {
$this->query = $this->select . $this->insert . $this->update . $this->delete . $this->create . $this->from . $this->join . $this->where . $this->group . $this->order . $this->limit;
}
$this->insert = " RETURNING id";
$this->result = pg_exec($this->connection, $this->query);
$this->inserted_id = $this->result;
$this->error = pg_errormessage($this->connection);
$this->affected_rows = pg_affected_rows($this->result);
$this->select = '';
$this->insert = '';
$this->update = '';
$this->delete = '';
$this->create = '';
$this->from = '';
$this->join = '';
$this->where = '';
$this->group = '';
$this->order = '';
$this->limit = '';
return $this;
}
示例5: my_handler
function my_handler($sql_insert)
{
global $table, $link, $new_name;
$sql_insert = ereg_replace($table, $new_name, $sql_insert);
$result = pg_exec($link, pre_query($sql_insert)) or pg_die(pg_errormessage($link), $sql_insert, __FILE__, __LINE__);
$sql_query = $sql_insert;
}
示例6: ChVisible
/**
* Изменить параметр "видимости" анонима на противоположный
*
* @param integer $aid идентификатор анонима
* @return char сообщение об ошибке
*/
function ChVisible($aid)
{
global $DB;
$sql = "UPDATE anonymous SET visible = NOT visible::bool WHERE id = ?";
$DB->squery($sql, $aid);
$error = pg_errormessage();
return $error;
}
示例7: get_address_by_serviceid
function get_address_by_serviceid($serviceprovider_id)
{
$result = pg_query_params("SELECT address_id FROM techmatcher.serviceprovidertoaddress WHERE serviceprovider_id=\$1 AND address_deleted=\$2", array($serviceprovider_id, "FALSE")) or die(pg_errormessage());
$names = array();
while ($name = pg_fetch_assoc($result)) {
$names[] = $name;
}
return $names;
}
示例8: ejecutarConsulta
public function ejecutarConsulta($sql)
{
$resultado = pg_query($this->conexion, $sql) or die("La consulta fallo1: " . pg_last_error($this->conexion));
if (!isset($resultado)) {
echo "La consulta fallo2: " . pg_errormessage();
exit;
}
return $resultado;
}
示例9: set_privilege
function set_privilege($sql_set_privilege)
{
global $link;
if (!($res = @pg_exec($link, $sql_set_privilege))) {
pg_die(pg_errormessage($link), $sql_set_privilege, __FILE__, __LINE__);
} else {
echo "<p>{$sql_set_privilege}</p>\n";
}
}
示例10: get_staff_for_provider
function get_staff_for_provider($serviceprovider_id)
{
$result = pg_query_params("SELECT spstaff_id FROM techmatcher.serviceprovidershavestaff WHERE serviceprovider_id = \$1", array($serviceprovider_id)) or die(pg_errormessage());
$names = array();
while ($name = pg_fetch_assoc($result)) {
$names[] = $name;
}
return $names;
}
示例11: setClientCharset
/**
* A method to set the client charset
*
* @param string $charset
* @return mixed True on success, PEAR_Error otherwise
*/
function setClientCharset($charset)
{
if (!empty($charset) && $this->oDbh) {
$pg = $this->oDbh->getConnection();
if (@pg_set_client_encoding($pg, $charset) == -1) {
return new PEAR_Error(pg_errormessage($pg));
}
}
return true;
}
示例12: connect
function connect()
{
$this->link = pg_connect("host='" . $this->hostname . "' port='" . $this->port . "' dbname='" . $this->db . "' user='" . $this->username . "' password='" . $this->password . "'");
if (!$this->link) {
$this->error = pg_errormessage($this->db);
return false;
}
$this->exeq("set search_path to '" . $this->schema . "'");
return true;
}
示例13: getSP_Rated
function getSP_Rated()
{
$qry = "SELECT * FROM techmatcher.ratingevents where ratingtotal>0;";
$result = pg_query_params($qry, array()) or die(pg_errormessage());
if (pg_num_rows($result) > 0) {
return $result;
} else {
return false;
}
}
示例14: FetchByMaster
function FetchByMaster($MasterName)
{
$sql = "\nSELECT id AS slave_port_id,\n name AS slave_port_name,\n category_id AS slave_category_id,\n category AS slave_category_name\n FROM ports_active\n WHERE master_port = '" . pg_escape_string($MasterName) . "'\nORDER BY slave_category_name, slave_port_name";
#echo "sql = <pre>$sql</pre>";
$this->LocalResult = pg_exec($this->dbh, $sql);
if (!$this->LocalResult) {
echo pg_errormessage() . " {$sql}";
}
$numrows = pg_numrows($this->LocalResult);
return $numrows;
}
示例15: Insert
function Insert()
{
# delete the ignore entry for this commit/port combination
$sql = "\nINSERT INTO commit_log_ports_ignore (commit_log_id, port_id, reason)\n values ({$this->commit_log_id}, {$this->port_id}, '" . pg_escape_string($this->reason) . "')";
echo "\$sql='<pre>{$sql}</pre><br>\n";
$this->result = pg_exec($this->dbh, $sql);
if (!$this->result) {
echo pg_errormessage() . " {$sql}";
}
$numrows = pg_affected_rows($this->result);
return $numrows;
}