Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2014, 11:33
Avatar de jodatelo
jodatelo
 
Fecha de Ingreso: marzo-2010
Ubicación: Ecuador
Mensajes: 65
Antigüedad: 14 años, 1 mes
Puntos: 1
Insertar link en un row

Hola estoy tratando de modificar un scrip datatables....
en estos momentos me muestra algo asi:
_____________________________________
No. | nombre | foto | foto 2
_____________________________________
1 daniel mifoto.jpg mifoto2.jpg
________________________________________

pero quiero que se muestre asi:

No. | nombre | foto | foto 2
_________________________________________
1 daniel mifoto.jpg (VER) mifoto2.jpg (VER)
__________________________________________________

intento todo y no me sale... a continuacion muestro los codigos espero me puedan ayudar....

este se llama procesar.php

Código PHP:
<?php
    
if (isset($_POST['tag'])) {
        try {
            
$conn = require_once 'connect.php';

            
$sql "SELECT * FROM mis_fotos";
            
$result $conn->prepare($sql) or die ($sql);

            if (!
$result->execute()) return false;

            if (
$result->rowCount() > 0) {
                
$json = array();
                while (
$row $result->fetch()) {
                    
$json[] = array(
                        
'id_user' => $row['id_user'],
                        
'foto1' =>$row['foto1'],
                        
'foto2' => $row['foto2'],
                        
'foto3' => $row['foto3'],
                        
'foto4' => $row['foto4'],
                        
'foto5' => $row['foto5']
                    );
                }

                
$json['success'] = true;
                echo 
json_encode($json);
            }
        } catch (
PDOException $e) {
            echo 
'Error: '$e->getMessage();
        }
    }

?>
este es el archivo functions.js:

Código:
$(document).ready(function() {
	$.ajax({
			url: './include/procesar.php',
			type: 'post',
			data: { tag: 'getData'},
			dataType: 'json',
			success: function (data) {
				if (data.success) {
					$.each(data, function (index, record) {
						if ($.isNumeric(index)) { 
							var row = $("<tr />");
							$("<td />").text(record.Orden).appendTo(row);
							$("<td />").text(record.foto1).appendTo(row);
							$("<td />").text(record.foto2).appendTo(row);
							$("<td />").text(record.foto3).appendTo(row);
							$("<td />").text(record.foto4).appendTo(row);
							$("<td />").text(record.foto5).appendTo(row);
							row.appendTo("table");
						}
					})
				}

				$('table').dataTable({
					"bJQueryUI": true,
					"sPaginationType": "full_numbers"
				})
			}
		});
})
Espero puedan guiarme por fa.... gracias