ya he probado
Código PHP:
pero no funciona si me pueden ayudar diciendome por donde tengo el error o bien diciendome cual es mi error , agradecido estare...Ver original
Código PHP:
Ver original
<?php //conexion a base de datos MySql include_once("../class/class.php"); { $sql = "SELECT * FROM contacto ORDER BY fecha ASC"; $r = mysql_query( $sql ) or trigger_error( mysql_error($conexion), E_USER_ERROR ); $return = ''; if( mysql_num_rows($r)>0){ $return .= '<table border=1>'; $cols = 0; $return .= '<tr>'; if($cols==0){ for($i=0; $i<$cols; $i++){ $cols_names[$i] = $col_name; } $return .= '</tr><tr>'; } for($i=0; $i<$cols; $i++){ #En esta iteraci車n podes manejar de manera personalizada datos, por ejemplo: if($cols_names[$i] == 'fechaAlta'){ #Fromateo el registro en formato Timestamp }else if($cols_names[$i] == 'activo'){ #Estado l車gico del registro, en vez de 1 o 0 le muestro Si o No. }else{ } } $return .= '</tr>'; } $return .= '</table>'; } } else { ?> <!doctype html> <html lang="en"> <head><meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>Document</title> <style> h1{ text-align: center; margin-top: 14%; color:#fff; } h1 a{ color: #fff; } </style> </head> <body style="background-color:#254584;"> <h1>Debes loguearte en <a href='index.php'>el formulario de login</a> para poder acceder.</h1> </body> </html> <?php } ?>