Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/12/2013, 05:08
chouki
 
Fecha de Ingreso: enero-2008
Mensajes: 88
Antigüedad: 16 años, 3 meses
Puntos: 0
rellenar los input de un formulario en php y mysql

hola
muy buenas a todos estoy intentando rellenar los inputs de un formulario apartir de un parámetro que lo tomo de un scritp,pero no llego a mostrarlos.
antes de mostrar los datos o sea antes de entrar en el while me sale el siguiente de error de Resource id #3. como resultado de la consulta.
Código PHP:
<?php
    $id
=$_GET['id'];
    
    
$c=mysql_pconnect("localhost""root""");
    if (!
$c)
      die( 
'Error'mysql_error() );
    
mysql_select_db("bd",$c) or die(mysql_error());
    
$r=mysql_query("select * from articles where idt=' $id '",$c) or    
    die(
mysql_error());
     
// al hacer un echo de $r me sale error de Resource id #3  
    //echo $r;die;
    
while($book=mysql_fetch_array($r))
    {

   
?>
   <tr>
    <td>Id:</td>
    <td><input type=text name=isbn value="<? echo $id;?>"</td>
  </tr>
  <tr>
    <td>Título:</td>
    <td><input type="hidden"  name=title
         value="<?= echo $book['title']"; ?>"></td></input>
  </
tr>
  <
tr>
    <
td>Precio:</td>
    <
td><input type=text name=price
               value
="<?=$book["price"]:""; ?>"></td>
  </
tr>
  <
tr>
     <
td>Descripción:</td>
     <
td><textarea rows=3 cols=50
          name
=description>
          <?=
$book["description"]:""?>
          </textarea></td>
  </tr>
  <?php  ?>
  <input type=image src="./imagenes/edit-iterm.jpg" width="25" height="15">
</center>
al final no llego a mostrar el resultado en los inputs
Muchas gracias por todo.