Bueno, el asunto es que deseo agregar lo que un usuario manda en un formulario al monto total del banco, y sacarlo de la billetera, ya cree el codigo, pero me lanza el error;
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '9223372036854775807 SET = '9223372036854775807'' at line 1
¿Que error tengo en la sintaxis?
(No tiene nada que ver con el topico anterior, asi que por favor no lo borren ;))
Las lineas donde esta el codigo que lanza error es de la 119 a la 130
Código php:
Ver original<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_TecnoPets = "mysql.webcindario.com";
$database_TecnoPets = "*********";
$username_TecnoPets = "*********";
$password_TecnoPets = "*********";
?>
<?php
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Esto es para restringir el acceso a la pagina
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// Por seguridad, primeramente, el visitante no podra entrar
$isValid = False;
// La varable de sesion es como el usuario si el esta logeado
// Y sino, se queda en blanco.
//
$arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); $isValid = true;
}
//
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "/logeo.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized
("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) { $MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; $MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location: ". $MM_restrictGoTo); }
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_dat = "-1";
if (isset($_SESSION['MM_Username'])) { $colname_dat = $_SESSION['MM_Username'];
}
$query_dat = sprintf("SELECT * FROM tecnopoints WHERE usuario = %s", GetSQLValueString
($colname_dat, "text"));
$colname_banco = "-1";
if (isset($_SESSION['MM_Username'])) { $colname_banco = $_SESSION['MM_Username'];
}
$query_banco = sprintf("SELECT * FROM banco WHERE usuario = %s", GetSQLValueString
($colname_banco, "text")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<link href="/estilo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p>
<?
if($_POST[ag] > $row_dat[tp]) { echo " No tienes tantos TP "; } else {
$yu = $row_dat[tp] - $_POST[ag];
$ya = $row_banco[tp] + $_POST[ag];
$montito = "UPDATE $row_dat[tp] SET = '$yu'";
$banqi = "UPDATE $row_banco[tp] SET = '$ya'";
};
?>
</p>
<p><a href="/index.php" target="_top">ACTUALIZAR DATOS</a></p>
</body>
</html>