mira es que tengo este código
para actualizar las tablas
Código PHP:
Ver original
$username = ""; $userid = ""; $username = ""; $creditos= ""; $userid = $_POST["uid"]; $username = $_POST["username"]; // Esla linia es la que estoy tratando que que al selecionar del 1 al 6 actualizae la fecha sumandole meses. $sql2 = mysql_query("UPDATE admins SET creditos= creditos - '".$creditos."' WHERE username='".$_SESSION["loginuser"]."'") or die ("Error editing admin user"); $status = "Usuario ".$username." Renovado!"; }
y este es el formulario
Código PHP:
Ver original
<?php require("includes/logincheck.php"); require("config.php"); require("includes/settings.php"); $userid = $_GET["id"]; } else { } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>.:: Administrador de Usuarios ::.</title> <link rel="shortcut icon" href="images/favicon.ico"> </head> <body onLoad="focus();edituser.username.focus()" background="images/bg.png"> <table width="850" border="3" align="center" bgcolor="#FFFFFF"> <tr> <td align="center"> <?php require("includes/header.php"); ?> </td> </tr> <tr> <td> <div align="center"><br /> <font size="6"><b>Administrador de Usuarios </b></font> <br /> <br /> </div> <br /> <div align="right"> <table width="240" border="3"> <tr> <th scope="col"><font size=-1> <b>Usuario Iniciado:</b> <?php echo $_SESSION["loginuser"] ; ?></font></th> <th scope="col"><font size=-1><a href='logout.php'>Logout</a></font></th> </tr> </table> </div> <br /> <table width="800" border="2" align="center"> <tr> <td><div align="center"><b>Renovar Usuario (<a href="controlpanel.php">Regresar al Panel Principal</a>)</b></div></td> </tr> <td> <form name="renovar" action="controlpanel.php" method="post"> <?php ?> <input type="hidden" name="uid" value="<?php print($line["id"]); ?>"> <input type="hidden" name="username" value="<?php print($line["name"]); ?>"><br> Nombre:<br> <strong><?php print($line["name"]); ?></strong> <br><br> Creditos Disponibles:<br> <b><font color="#FF0000">( <u><?php print($cred["creditos"]); ?></u> )</font> </b> <br><br> Renovar Cuenta:<br> <input type="text" name="addfin" size="10" tabindex="1" value="<?php print($line["expiredate"]); ?>" readonly> <br><br> Renovar:<br> <select name="creditos"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> </select> Meses<br> <input type="submit" name="renovuser" value="Renovar" tabindex="2" class="submit" accesskey="r" title="(ALT+r)"> </form> </td> </tr> </table> <hr> <div align="center"> <?php require("includes/footer.php"); ?></div> </td> </tr> </table> </td> </tr> </table> </body> </html>
hay les dejo a ver que es lo que estoy haciendo mal ya que no suma el mes lo que hace es actualizar la fecha a la que esta actual.