Estoy haciendo esta actualizacion con dreamweaver, el caso es que necesito actualizar los datos del usuario que se ha logueado, por ello necesito capturar el usuario que se logueo con MM_USERNAME, he realizado el proceso, pero al ejecutar me dice "field list" y siginifca que los campos estan vacios.
Hasta donde se es por que no me ejecutar el SQL update como es. La cuestion es que no he podido cuadrar como insertar el MM_USERNAME en el update ando perdido, gracias si me pueden ayudar aqui esta el codigo
Código PHP:
<?php require_once('../../../Connections/conex.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
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_Actualizar = "-1";
if (isset($_GET['MM_Username'])) {
$colname_Actualizar = $_GET['MM_Username'];
}
mysql_select_db($database_conex, $conex);
$query_Actualizar = sprintf("SELECT NumIngreso, UltimoIngreso, IngresoHora FROM usuarios WHERE Usuario = %s", GetSQLValueString($colname_Actualizar, "text"));
$Actualizar = mysql_query($query_Actualizar, $conex) or die(mysql_error());
$row_Actualizar = mysql_fetch_assoc($Actualizar);
$totalRows_Actualizar = mysql_num_rows($Actualizar);
mysql_select_db("$database_conex, $conex");
$Fecha= date('Y-m-d');
$Hora= date('H:i:s',time() - 3600);
$ingresos = $row_Actualizar['NumIngreso'];
$Numingreso =$ingresos+1;
$sql="UPDATE INTO usuarios (UltimoIngreso,IngresoHora,NumIngreso) VALUES('$Fecha','$Hora','$Numingreso')";
mysql_query($sql);
echo "
<script>
alert('ACTUALIZADO SATISFACTORIAMENTE');
location.href='Guia.php'
</script>";
?>
<!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=iso-8859-1" />
<title>Insertar datos en MySQL</title>
<style type="text/css">
<!--
body {
font-family: "Trebuchet MS", Tahoma, Arial;
font-size: 12px;
color: #333333;
}
h2 {
font-size: 16px;
color: #CC0000;
}
input, select {
font-family: "Trebuchet MS", Tahoma, Arial;
font-size: 11px;
color: #666666;
}
-->
</style>
</head>
<body>
<h2> </h2>
</body>
</html>
<?php
mysql_free_result($Actualizar);
?>