Ver Mensaje Individual
  #7 (permalink)  
Antiguo 23/06/2009, 07:05
angelosss
 
Fecha de Ingreso: abril-2009
Mensajes: 104
Antigüedad: 15 años
Puntos: 0
Respuesta: AJAX como recargar el contenido de una tabla

esto es el codigo php

Código PHP:
$nivel utf8_encode($_GET['nivel']);

$titulacion $_GET['titulo'];

$centro $_GET['centro'];

$fecha_inicio $_GET['fecha_inicio'];
$fecha_final $_GET['fecha_final'];
$cursando $_GET['fecha_final'];
$especialidad $_GET['especialidad'];



$sql "INSERT INTO  estudios (
id_estudios,
nivel,
titulacion,
centro,
fecha_inicio,
id_candidato,
fecha_final,
cursando,
especialidad
)
VALUES (
NULL ,  '"
.$nivel."',  '".$titulacion."',  '".$centro."',  '".$fecha_inicio."',  '".$_SESSION['id_candidato']."',  '".$fecha_final."',  '".$cursando."',  '".$especialidad."'
);"
;

$s mysql_query($sql) or die("Error al intentar seleccionar les dades de l'usuari");
$msg "Estudio Añadido con exito.";  
echo 
$msg;      

mysql_close($connexio); 
conel que hago los innsert , la tabla que te he puesto antes es la que los muestra con esete codigo:

Código PHP:
<div id="cuerpo" style="background-color:#FFFFFF; padding-left:20px; padding-right:20px;">
          

             <table width="100%" bgcolor="#FFFFFF">     
            <tbody id="est1">
            <tr>
                <th class="texto_tb1" style="font-weight:normal; padding:10px;">Fecha</th>
                <th class="texto_tb1" style="font-weight:normal; padding:10px;">Titulacion</th>
                <th class="texto_tb1" style="font-weight:normal; padding:10px;">Especialidad</th>
                <th class="texto_tb1" style="font-weight:normal; padding:10px;">Nivel</th>
                <th class="texto_tb1" style="font-weight:normal; padding:10px;">Centro</th>
                <th class="texto_tb1" style="font-weight:normal; padding:10px;">&nbsp;</th>
                <th class="texto_tb1" style="font-weight:normal; padding:10px;">&nbsp;</th>
            </tr>
             <? 
include('others/conexion.php');
$connexio =  mysql_connect($servidor,$user,$contrasenya) or die("No puc connectar amb el servidor");             
mysql_select_db($base_datos,$connexio) or die ("No puc connectar amb la base de dades");
$a 1;
$sql "SELECT * FROM estudios WHERE id_candidato = ".$_SESSION['id_candidato'];
$resultat mysql_query($sql) or die("Error al intentar seleccionar les dades de l'usuari");  
                
$valores mysql_fetch_array($resultat);
                
                while(
$valores != FALSE){
                
                 if (
$a%2==1) {
    echo 
'<tr><td class="texto_tb4" align="center">'.$valores['fecha_inicio'].' - '.$valores['fecha_final'].'</td><td class="texto_tb4">'.$valores['titulacion'].'</td><td class="texto_tb4">'.utf8_decode($valores['especialidad']).'</td><td class="texto_tb4">'.utf8_decode($valores['nivel']).'</td><td class="texto_tb4">'.$valores['centro'].'</td>
    <td class="texto_tb4"><a href="modificar_estudios.php?id_est='
.$valores['id_estudios'].'" rel="lyteframe" title="Reglas de uso de Amyjobs" 
   rev="width: 600px; height: 300px; scrolling: no;"><img src="imagenes/lapiz_01.gif" style="cursor:pointer;"></a></td><td class="texto_tb4"><a href="eliminar_est.php?id_est='
.$valores['id_estudios'].'">&nbsp;<img src="imagenes/basura_01.gif" style="cursor:pointer;">&nbsp;</a></td>
    </tr>'
;
        }else{            
         
echo 
'<tr><td class="texto_tb5" align="center">'.$valores['fecha_inicio'].' - '.$valores['fecha_final'].'</td><td class="texto_tb5">'.$valores['titulacion'].'</td><td class="texto_tb5">'.utf8_decode($valores['especialidad']).'</td><td class="texto_tb5">'.utf8_decode($valores['nivel']).'</td><td class="texto_tb5">'.$valores['centro'].'</td>
<td class="texto_tb5"><a href="modificar_estudios.php?id_est='
.$valores['id_estudios'].'" rel="lyteframe" title="Reglas de uso de Amyjobs" 
   rev="width: 600px; height: 300px; scrolling: no;"><img src="imagenes/lapiz_01.gif" style="cursor:pointer;"></a></td><td class="texto_tb5"><a href="eliminar_est.php?id_est='
.$valores['id_estudios'].'">&nbsp;<img src="imagenes/basura_01.gif" style="cursor:pointer;">&nbsp;</a></td>
    </tr>'
;

        }
                    
$valores mysql_fetch_array($resultat);
                
                
$a $a 1;
                }
            
?>
            <tbody>
            </table>  
      
      </div>
bueno esto es, gracias