elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18
111  Programación / PHP / Ayuda con listado de usuarios. en: 26 Febrero 2010, 23:22 pm
Buenas  :laugh:

   En un formulario que estoy haciendo, tengo que poner un menu/lista, pero quiero que este menu/lista muestre los usuarios actuales de la tabla staff. Y tengo el siguiente codigo que yo hice, pero al parecer no funciona :(
Código:
<!-- SEND MESSAGE TO A USER -->
<form id="form1" name="form1" method="post" action="insertmessage.php">
<label><br />  
    TO:
    <select name="show_users" id="show_users">
    <!-- SHOW USER FROM TABLE STAFF -->
    <?php
   include("validdb.php");
   $result=mysql_query("select * from staff") or die(mysql_error());
   while($row = mysql_fetch_array($result))
    {
      echo "<option>".$row[user]."</option>";
   }
   mysql_free_result($result);
?>
    </select>
</label>

Alguna idea?? Muchas Gracias:D
Me da error en la linea 25 que es:
$result=mysql_query("select * from staff") or die(mysql_error());
pero no entiendo porque, la tabla si existe "staff".. y validdb.php es correcto
112  Programación / Bases de Datos / Duda sobre insersion a tabla html desde tabla sql en: 20 Febrero 2010, 00:57 am
Estoy haciendo un pequeño sistema de reservaciones para el lugar donde trabajo y aunque me he quemado el coco pensando como podria hacer para que esta tabla funcione nadamas no doi.
Esta tabla muestra habitaciones y muestra los numeros de 1 al 31 (eso de poner los numeros automaticamente segun el mes lo hare mas adelante) este es el codigo de la tabla:
Código:
<table border="1" align="center">
  <tr>
    <td>&nbsp;</td>
    <td>01</td>
    <td>02</td>
    <td>03</td>
    <td>04</td>
    <td>05</td>
    <td>06</td>
    <td>07</td>
    <td>08</td>
    <td>09</td>
    <td>10</td>
    <td>11</td>
    <td>12</td>
    <td>13</td>
    <td>14</td>
    <td>15</td>
    <td>16</td>
    <td>17</td>
    <td>18</td>
    <td>19</td>
    <td>20</td>
    <td>21</td>
    <td>22</td>
    <td>23</td>
    <td>24</td>
    <td>25</td>
    <td>26</td>
    <td>27</td>
    <td>28</td>
    <td>29</td>
    <td>30</td>
    <td>31</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Room 1</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 1</td>
  </tr>
  <tr>
    <td>Room 2</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 2</td>
  </tr>
  <tr>
    <td>Room 3</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 3</td>
  </tr>
  <tr>
    <td>Room 4</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 4</td>
  </tr>
  <tr>
    <td>Room 5</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 5</td>
  </tr>
  <tr>
    <td>Room 6</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 6</td>
  </tr>
  <tr>
    <td>Room 7</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 7</td>
  </tr>
  <tr>
    <td>Room 8</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 8</td>
  </tr>
  <tr>
    <td>Room 9</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Room 9</td>
  </tr>
  <tr>
    <td>Mansion 1</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Mansion 1</td>
  </tr>
  <tr>
    <td>Mansion 2</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Mansion 2</td>
  </tr>
  <tr>
    <td>Mansion 3</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Mansion 3</td>
  </tr>
  <tr>
    <td>Condo 1</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Condo 1</td>
  </tr>
  <tr>
    <td>Condo 2</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Condo 2</td>
  </tr>
  <tr>
    <td>Condo 3</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Condo 3</td>
  </tr>
</table>

En realidad lo que quiero es que si el cliente Mr. Test reservo de el 15/Enero/2010 al 19/Febrero/2010 aparezca en esta tabla marcando todos los dias en los que estara hospeado Mr. Test, ya sea con un color o con puro texto, que sea su nombre que sea un link a la infomacion del cliente. Pero no se me ocurre, alguien me puede dar una manita o algun dato porfavor?

Se los agradeceria muchisimo.
113  Programación / PHP / Re: Problema al ingresar registros a una Tabla en: 18 Febrero 2010, 22:10 pm
hehe wooow xD muy bien muchisimas gracias :D:D
me gusta la tarea xD
no la de mi escuela, pero la que tenga que ver con los ordenadores me fascina
:D

Muuuuchas gracias xD
114  Programación / PHP / Re: Problema al ingresar registros a una Tabla en: 18 Febrero 2010, 20:21 pm
En validform.php
xD Gracias, por eso es bueno preguntar xD
115  Programación / PHP / Re: Problema al ingresar registros a una Tabla en: 18 Febrero 2010, 20:21 pm
si esto es para aprender php+mysql esta bien... si es un trabajo vas a ser owneado porque sos vulnerable a sqli

como ya te dijo yoyahack... estas tomando los datos por donde no debes xD usa $_POST['campo']

si podes aprender/usar mysql o PDO y prepared statements mucho mejor xD yo no usaria el codigo de arriba :P


En realidad mi nivel de mysql es muy basico aun xD
Me podrias dar una idea de como podria ir mejorado el codigo, solo una idea porfavor xD:D
116  Programación / PHP / Re: Problema al ingresar registros a una Tabla en: 18 Febrero 2010, 20:17 pm
Creo que habia olvidado fijarme en ese pequeño detalle :( haha pero muchas gracias..
Y esto de verificar que todas las variables tengan un valor, eso lo tengo que poner en validdb.php cierto?
117  Programación / PHP / Problema al ingresar registros a una Tabla en: 18 Febrero 2010, 20:00 pm
Despues de intentar varias cosas y al ver que ninguna tubo resultado es mi deber postear mi problema en el foro  ;-)

El problema es este:
Tengo un formulario "newclient.html" con action="validform.php"; que toma los datos del cliente y los inserta en la tabla 'clientlist' pero el problema es que cuando inserta los registros, los ingresa vacios, es decir.. Al registrar al cliente con ID 1 el nombre, apellido, bla bla bla.. estan en blanco, aunque el formulario haya sido llenado correctamente.
Código:
<form id="form1" name="form1" method="get" action="validform.php">
<table width="253" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="82">name ::</td>
    <td width="165"><label>
      <input type="text" name="name" id="name" />
    </label></td>
  </tr>
  <tr>
    <td>surname ::</td>
    <td><label>
      <input type="text" name="last_name" id="last_name" />
    </label></td>
  </tr>
  <tr>
    <td><p>gender ::</p></td>
    <td><label>
      <select name="gender" size="1" id="gender">
        <option selected="selected">male</option>
        <option>female</option>
        <option>shemale</option>
      </select>
    </label></td>
  </tr>
  <tr>
    <td>birthdate ::</td>
    <td><label>
      <input type="text" name="birthdate" id="birthdate" />
    </label></td>
  </tr>
  <tr>
    <td><p>mail ::</p></td>
    <td><label>
      <input type="text" name="mail" id="mail" />
    </label></td>
  </tr>
  <tr>
    <td>phone ::</td>
    <td><label>
      <input type="text" name="phone" id="phone" />
    </label></td>
  </tr>
  <tr>
    <td>emergency ::</td>
    <td><label>
      <input type="text" name="emerg_phone" id="emerg_phone" />
    </label></td>
  </tr>
  <tr>
    <td>cc_num ::</td>
    <td><label>
      <input type="text" name="cc_info" id="cc_info" />
    </label></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><label>
      cvc:
      <input type="text" name="cvc" id="cvc" />
    </label>
      <label>
        <br />
        exp:
        <input type="text" name="exp" id="exp" />
    </label></td>
  </tr>
  <tr>
    <td>comments ::</td>
    <td><label>
      <textarea name="comments" id="comments" cols="25" rows="3"></textarea>
    </label></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><label>
      <input type="submit" name="send" id="send" value="Enviar" />
    </label></td>
  </tr>
</table>
</form>
*El formulario es muy simple porque lo rehice y es de prueba

en "validform.php" tengo:
Código:
<?php
include("validdb.php");
$link=Conectarse();
$no=$_GET["ID"];
$name=$_GET["name"];
$last_name=$_GET["last_name"];
$phone=$_GET["phone"];
$emerg_phone=$_GET["emerg_phone"];
$mail=$_GET["mail"];
$gender=$_GET["gender"];
$birthdate=$_GET["birthdate"];
$cc_info=$_GET["cc_info"];
$cvc=$_GET["cvc"];
$exp=$_GET["exp"];
$comments=$_GET["comments"];
mysql_query("insert into clientlist (ID,name,last_name,phone,emerg_phone,mail,gender,birthdate,cc_info,cvc,exp,comments) values ('$no','$name','$last_name','$phone','$emerg_phone','$mail','$gender','$birthdate','$cc_info','$cvc','$exp','$comments')",$link) or die(mysql_error());
header('Location: clientlist.php')
?>

El codigo en validdb.php es completamente correcto, tanto lo es que ingresa los campos vacios a la db.
Como dato: Todo este proceso funcionaba a la perfeccion, pero cuando agrege un campo a la tabla en clientlist.php para Borrar los registros -que tambien funciono perfectamente- desde ahi empeze a tener problemas con la insercion de registros.
Aunque lo mas raro -para mi- fue que hasta intente cambiando de servidor y el problema persiste.
Código:
<?php
   include("validdb.php");
   $link=Conectarse();
   $result=mysql_query("select * from clientlist",$link) or die(mysql_error());
?>
<table height="36" border=1 align="center" cellpadding=0 cellspacing=0>
   <tr>
     <td width="12" height="14" bgcolor="#FFCC00"><b> # </b></td>
     <td width="49" bgcolor="#FF6600"><b> Name</b></td>
     <td width="46" bgcolor="#FFCC00"><b>Last Name</b></td>
     <td width="50" bgcolor="#FF6600"><b>Phone</b></td>
     <td width="64" bgcolor="#FFCC00"><b>Emerg Phone</b></td>
     <td width="40" bgcolor="#FF6600"><b>Email</b></td>
     <td width="41" bgcolor="#FFCC00"><b>Gender</b></td>
     <td width="58" bgcolor="#FF6600"><b>Brithdate</b></td>
     <td width="99" bgcolor="#FFCC00"><b>CC num</b></td>
     <td width="26" bgcolor="#FF6600"><b>CVC</b></td>
     <td width="43" bgcolor="#FFCC00"><b>EXP</b></td>
     <td width="123" bgcolor="#FF6600"><b>Comments</b></td>
     <td width="63" bgcolor="#FFCC00"><b>Delete</b></td>
   </tr>

   <?php  
   while($row = mysql_fetch_array($result))
    {
      printf("<tr><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td> %s </td><td><a href=\"borra_client.php?id=%d\">Delete</a></td></tr>",$row["ID"],$row["name"],$row["last_name"],$row["phone"],$row["emerg_phone"],$row["mail"],$row["gender"],$row["birthdate"],$row["cc_info"],$row["cvc"],$row["exp"],$row["comments"],$row["ID"]) or die(mysql_error());
   }
  
   mysql_free_result($result);
   mysql_close($link);
?>
</table>

Espero me puedan hechar una manita; se los agradeceria mucho.
Saludos :D
118  Programación / PHP / Re: Ayuda con enumeracion de filas en: 14 Febrero 2010, 09:36 am
Wooow xD funcionaaa
Citar
CREATE TABLE `axxxxxxx_infoc`.`infoc` (
`ID` BIGINT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 30 ) NOT NULL ,
`last_name` VARCHAR( 30 ) NOT NULL ,
`phone` VARCHAR( 20 ) NOT NULL ,
`emerg_phone` VARCHAR( 20 ) NOT NULL ,
`mail` VARCHAR( 35 ) NOT NULL ,
`gender` VARCHAR( 8 ) NOT NULL ,
`birthdate` VARCHAR( 8 ) NOT NULL ,
`cc_info` VARCHAR( 16 ) NOT NULL ,
`cvc` VARCHAR( 3 ) NOT NULL ,
`exp` VARCHAR( 5 ) NOT NULL ,
`comments` VARCHAR( 350 ) NOT NULL ,
PRIMARY KEY ( `ID` , `mail` )
) ENGINE = MYISAM

Muchisimas gracias Ari-Slash, tube que volver a hacer la tabla xD
Saludoooos :D
119  Programación / PHP / Re: Ayuda con enumeracion de filas en: 14 Febrero 2010, 09:12 am
No, en realidad ninguno es primary key.
Creo que estoy un poco desorientado cierto?
haha :(
Trate haciedno el campo No como BIGINT pero sin auto_incremente
de ahi lo hice Primary Key y entonces poner el auto_increment y me devolvio esto;:
Citar
Error

SQL query:

ALTER TABLE `infoc` ADD PRIMARY KEY ( `No` )

MySQL said: Documentation
#1062 - Duplicate entry '0' for key 1
120  Programación / PHP / Re: Ayuda con enumeracion de filas en: 14 Febrero 2010, 08:56 am
Es que me sale el mismo error, desde que me salio la primera vez lo intente marcando la casilla de PRIMARY(KEY) y fue el mismo error.
Lo intente como me lo acabas de decir, y es el mismo error otra vez :(
Saludooss
Páginas: 1 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines