本文整理汇总了PHP中mssql_error函数的典型用法代码示例。如果您正苦于以下问题:PHP mssql_error函数的具体用法?PHP mssql_error怎么用?PHP mssql_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mssql_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Login
function Login()
{
$link = Conectarse();
$consulta = "SELECT * FROM [022BDCOMUN].DBO.USUARIOS\r\nWHERE usuario='{$this->user}' AND contrasena='{$this->pass}' AND idtipousuario=2 ";
$resultado = mssql_query($consulta, $link) or die(mssql_error());
$fila = mssql_fetch_array($resultado);
if (!$fila[0]) {
echo '<script>
alert("Usuario o Password errados, por favor verifique.")
self.location = "/adm-reserva/"
</script>';
} else {
if (!isset($_SESSION)) {
@session_start();
}
$_SESSION['id_usuario'] = $fila['id_usuario'];
$_SESSION['nombres'] = $fila['nombres'];
$_SESSION['apellidos'] = $fila['apellidos'];
$_SESSION['starsoft'] = $fila['starsoft'];
$_SESSION['idempresa'] = $fila['idempresa'];
$_SESSION['idarea'] = $fila['idarea'];
$_SESSION['aud_jefe'] = $fila['aud_jefe'];
header("Location: /adm-reserva/home");
}
}
示例2: Registrar
function Registrar($nombres, $apellidos, $dni, $starsoft, $tipousuario, $area)
{
$link = Conectarse();
$consulta = "SELECT * from [022BDCOMUN].DBO.usuarios WHERE dni='{$dni}'";
$resultado = mssql_query($consulta) or die(mssql_error());
if (mssql_num_rows($resultado) == 0) {
$SQL = "INSERT INTO [022BDCOMUN].dbo.usuarios(nombres,apellidos,dni,starsoft,\r\n \tidarea,idempresa,usuario_starsoft,centro_costos,aud_jefe,usuario,contrasena,\r\n \tidtipousuario)\r\n VALUES('{$nombres}','{$apellidos}','{$dni}','{$starsoft}','{$area}','1','','','',\r\n \t'{$dni}','{$dni}','{$tipousuario}')";
$RESULT = mssql_query($SQL);
if (!$RESULT) {
echo "<script>\r\n\t alert('Error');\r\n\t window.location='/adm-reserva/consulta/usuarios';\r\n\t </script>";
} else {
header('Location: /adm-reserva/consulta/usuarios');
}
} else {
echo "<script>\r\n\t alert('Ya esta registrado');\r\n\t window.location='/adm-reserva/consulta/usuarios';\r\n\t </script>";
}
}
示例3: _connect
private function _connect()
{
switch ($this->_engine) {
case "mssql":
$this->_dbhandle = mssql_connect($this->_server, $this->_user, $this->_pass);
if (!$this->_dbhandle) {
die('No pudo conectarse: ' . mssql_error());
}
$selected = $this->_selectdb();
break;
case "mysql":
$this->_dbhandle = mysql_connect($this->_server, $this->_user, $this->_pass);
if (!$this->_dbhandle) {
die('No pudo conectarse: ' . mysql_error());
}
mysql_set_charset('utf8', $this->_dbhandle);
$selected = $this->_selectdb();
break;
}
}
示例4: Existe
function Existe($nrorequi, $usuario, $solicitante)
{
$link = Conectarse();
$consulta = "SELECT * from [010BDCOMUN].DBO.REQUISC where NROREQUI='{$nrorequi}' AND \r\nCODSOLIC='{$solicitante}'";
$resultado = mssql_query($consulta) or die(mssql_error());
if (mssql_num_rows($resultado) == 0) {
echo "<script>\r\n alert('No existe el RQ o no te pertenece');\r\n window.location='/reserva/pages/registrar-rq';\r\n </script>";
} else {
$consulta1 = "SELECT * from [022BDCOMUN].DBO.AUD_RQ where NROREQUI='{$nrorequi}' AND \r\nCODSOLIC='{$solicitante}'";
$resultado1 = mssql_query($consulta1) or die(mssql_error());
if (mssql_num_rows($resultado1) == 0) {
$SQL = "INSERT INTO AUD_RQ VALUES('{$nrorequi}','{$solicitante}','RQ','{$usuario}',GETDATE(),'P','','','')";
$RESULT = mssql_query($SQL);
if (!$RESULT) {
echo "<script>\r\nalert('Error al Registrar);\r\nwindow.location='/reserva/pages/registrar-rq';\r\n</script>";
} else {
echo "<script>\r\nalert('Registro exitoso');\r\nwindow.location='/reserva/pages/registrar-rq';\r\n</script>";
}
} else {
echo "<script>\r\n alert('YA ESTA REGISTRADO');\r\n window.location='/reserva/pages/registrar-rq';\r\n </script>";
}
}
}
示例5: AgregarArticulo
function AgregarArticulo($kit, $codigo, $cantidad)
{
$link = Conectarse();
$consulta = "SELECT * FROM [010BDCOMUN].DBO.MAEART WHERE ACODIGO='{$codigo}'";
$resultado = mssql_query($consulta) or die(mssql_error());
if (mssql_num_rows($resultado) == 0) {
echo "<script>\r\nalert('No existe el código');\r\nwindow.location='/reserva/pages/kit-reparacion?id={$kit}';\r\n</script>";
} else {
$consulta = "SELECT * FROM [022BDCOMUN].DBO.KITS_REPARACION \r\nWHERE CODKIT='{$kit}' AND CODART='{$codigo}'";
$resultado = mssql_query($consulta) or die(mssql_error());
if (mssql_num_rows($resultado) == 0) {
$SQL = "INSERT INTO [022BDCOMUN].DBO.KITS_REPARACION\r\n(CODART,CODKIT,CANART,KDESCRI,KUNIDAD,FECHA_CREACION)\r\n SELECT ACODIGO,'{$kit}','{$cantidad}',ADESCRI,AUNIDAD,GETDATE() from \r\n [010BDCOMUN].DBO.MAEART WHERE \r\nACODIGO='{$codigo}'";
$RESULT = mssql_query($SQL);
if (!$RESULT) {
echo "error";
} else {
echo "<script>\r\n\twindow.location='/reserva/pages/kit-reparacion?id={$kit}';\r\n\t</script>";
}
} else {
echo "<script>\r\nalert('Ya esta registrado');\r\nwindow.location='/reserva/pages/kit-reparacion?id={$kit}';\r\n</script>";
}
}
}
示例6: ob_start
<?php
ob_start();
session_start();
include 'dbconn.php';
include 'header_info.php';
include '../conn/conn_x.php';
//error_reporting( error_reporting() & ~E_WARNING);
//error_reporting( error_reporting() & ~E_NOTICE );
$url_i_ = $_SESSION['url'] = print_r($_REQUEST['url_i'], true);
$token = $_SESSION['token'] = print_r($_REQUEST['token_i'], true);
include '../track/track.php';
echo 'Download starting....<br/>';
$token_check_s = mssql_query("SELECT * FROM wasp_planet.dbo.f_token WHERE token ='{$token}'", $dbhandle) or die(mssql_error());
//May not be running
$token_s = mssql_fetch_array($token_check_s);
//May not be running
$row_d = mysql_fetch_assoc($url_check);
if ($token_s) {
if ($token_s['used'] == 0) {
/* Download Documenting */
$display_u = "SELECT * FROM games WHERE url = '{$url_i_}'";
$display_u_proc = mysql_query($display_u);
$row_u = mysql_fetch_assoc($display_u_proc);
$g_id = $row_u["g_id"];
$u_id = $row_u["u_id"];
$used = 1;
//Update used to 1
$used_update = mssql_query("UPDATE wasp_planet.dbo.f_token SET used = '1' WHERE token = '{$token}'", $dbhandle);
if ($used_update) {
?>
示例7: fetch_value
public function fetch_value($table, $field, $condition = null)
{
if (!$table || !$field) {
exit("Arguments Missing !!");
}
$query = "select {$field} from {$table}";
if ($condition != null) {
$query = "select {$field} from {$table} where {$condition}";
}
$this->query = $query;
$this->result = mssql_query($query) or $this->setError(mssql_error(), mssql_errno());
if ($this->result) {
$this->rows = intval(mssql_num_rows($this->result));
$this->row = mssql_fetch_object($this->result);
return $this->row->{$field};
}
}
示例8: Conectarse
<div class="row">
<form action="../procesos/registrarconsultarkit.php" method="POST">
<input type="hidden" name="tipo" value="rep">
<div class="col-md-12">
<h3 class="text-success">CONSULTAR KIT DE REPARACIÓN</h3>
<div class="form-group">
<select name="codigo" class="form-control"required>
<option value="">[SELECCIONAR]</option>
<?php
$link = Conectarse();
$SQL = "SELECT CODKIT,KDESCRI FROM KITS_REPARACION WHERE KUNIDAD='REP'\r\nORDER BY CODKIT";
$RESULT = mssql_query($SQL) or die(mssql_error());
while ($row = mssql_fetch_array($RESULT)) {
?>
<option value ="<?php
echo $row['CODKIT'];
?>
">
<?php
echo $row['CODKIT'] . ' - ' . $row['KDESCRI'];
?>
</option>
<?php
}
?>
</select>
</div>
示例9: error
<?php
// Establish connection
$host = $PHPSPLOIT["HOST"];
$user = $PHPSPLOIT["USER"];
$pass = $PHPSPLOIT["PASS"];
$conn = @mssql_connect($host, $user, $pass);
if (!$conn) {
return error("ERROR: %s: %s", @mssql_errno(), @mssql_error());
}
//@mssql_close($connect);
// NOTE:
// commented due to a bug in rare servers (bug found in iis6.0/php5.2.11)
return "OK";
示例10: getServerVersion
public function getServerVersion($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
{
if (strlen(trim($dbIP)) <= 0) {
$dbIP = DB_HOST;
}
if ($link = @mssql_connect($dbIP, $dbUser, $dbPasswd)) {
@mssql_select_db(DB_NAME, $link);
$oResult = @mssql_query("select substring(@@version, 21, 6) + ' (' + CAST(SERVERPROPERTY ('productlevel') as varchar(10)) + ') ' + CAST(SERVERPROPERTY('productversion') AS VARCHAR(15)) + ' ' + CAST(SERVERPROPERTY ('edition') AS VARCHAR(25)) as version; ", $link);
$aResult = @mssql_fetch_array($oResult);
@mssql_free_result($oResult);
$v = $aResult[0];
} else {
throw new Exception(@mssql_error($link));
}
return isset($v) ? $v : 'none';
}
示例11: getErrorMsg
public function getErrorMsg()
{
$msg = '';
if ($this->conn_id) {
$msg = mssql_error($this->conn_id);
} else {
$msg = mssql_error();
}
return $msg;
}
示例12: connect
public function connect()
{
if ($this->connected) {
return $this->connected;
}
$failed = false;
try {
$this->db = mssql_connect($this->url, $this->auth1, $this->auth2) or $failed = true;
if ($failed && $this->debug) {
echo "Could not connect to database: " . htmlspecialchars(mssql_error());
}
} catch (Exception $e) {
$failed = true;
}
if ($failed) {
$this->connected = false;
return false;
} else {
mssql_select_db($this->dbname, $this->db) or $failed = true;
if ($failed && $this->debug) {
echo "Could not select database named '" . htmlspecialchars($this->dbname) . "': " . mysqli_error();
$this->connected = false;
return false;
}
$this->connected = true;
return true;
}
}
示例13: ReservaVacia
function ReservaVacia($reserva, $usuario)
{
$link = Conectarse();
$consulta = "SELECT C.NRORESERVA,C.OT,C.USUARIO,C.CENTROCOSTO,\r\nC.TIPO FROM [022BDCOMUN].DBO.RESERVA_CAB AS C\r\nWHERE C.ESTADO='00' AND C.USUARIO='{$usuario}' AND C.NRORESERVA='{$reserva}'\r\nAND C.NRORESERVA NOT IN (SELECT D.NRORESERVA FROM [022BDCOMUN].DBO.RESERVA_DET AS D)\r\nORDER BY C.NRORESERVA";
$resultado = mssql_query($consulta) or die(mssql_error());
if (mssql_num_rows($resultado) == 0) {
echo "";
} else {
echo "<a href='../procesos/reserva?reserva={$reserva}&tipo=reservavacia'>\r\n<i class='fa fa-trash text-danger fa-3x'></i></a>";
}
}
示例14: queryBatch
/**
* Execute a batch query
* @return mixed A database resource if successful, FALSE if not.
*/
function queryBatch($abort_on_error = true, $p_transaction_safe = false)
{
$this->_errorNum = 0;
$this->_errorMsg = '';
if ($p_transaction_safe) {
$si = mssql_get_server_info($this->_resource);
preg_match_all("/(\\d+)\\.(\\d+)\\.(\\d+)/i", $si, $m);
if ($m[1] >= 4) {
$this->_sql = 'START TRANSACTION;' . $this->_sql . '; COMMIT;';
} else {
if ($m[2] >= 23 && $m[3] >= 19) {
$this->_sql = 'BEGIN WORK;' . $this->_sql . '; COMMIT;';
} else {
if ($m[2] >= 23 && $m[3] >= 17) {
$this->_sql = 'BEGIN;' . $this->_sql . '; COMMIT;';
}
}
}
}
$query_split = preg_split("/[;]+/", $this->_sql);
$error = 0;
foreach ($query_split as $command_line) {
$command_line = trim($command_line);
if ($command_line != '') {
$this->_cursor = mssql_query($command_line, $this->_resource);
if (!$this->_cursor) {
$error = 1;
$this->_errorNum .= mssql_errno($this->_resource) . ' ';
$this->_errorMsg .= mssql_error($this->_resource) . " SQL={$command_line} <br />";
if ($abort_on_error) {
return $this->_cursor;
}
}
}
}
return $error ? false : true;
}
示例15: mssql_query
$retval = mssql_query($sql);
if (!$retval) {
die('Could not enter data: ' . mssql_error());
}
if ($retval) {
header('Location:viewtags.php?id=' . $dbid);
//http_redirect("viewtags.php", array("id" => $dbid), true, HTTP_REDIRECT_PERM);
}
exit;
}
} else {
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if (isset($_GET['tid']) && is_numeric($_GET['tid']) && $_GET['tid'] > 0) {
// query database
$tid = $_GET['tid'];
$resTag = mssql_query("SELECT * FROM RM_Tag WHERE TagID={$tid}") or die(mssql_error());
$rowTag = mssql_fetch_array($resTag);
if ($rowTag) {
//TagCode, TagName, TagOrder, TagIsActive , InstantCustomerCampaignID_C
// get data from database
$formData['TagID'] = $rowTag['TagID'];
$formData['TagCode'] = $rowTag['TagCode'];
$formData['TagName'] = $rowTag['TagName'];
$formData['TagOrder'] = $rowTag['TagOrder'];
$formData['TagIsActive'] = $rowTag['TagIsActive'];
$formData['InstantCustomerCampaignID_C'] = $rowTag['InstantCustomerCampaignID_C'];
}
}
}
}
?>