__________________________
| NOMBRE | TELEFONO |
---------------------------------------
| maria | 2005793739|
| jorge | 26984395895|
--------------------------------------
este es el codigo que tengo, pero no logro mostrarlo ----->
Código:
<?php $link = mysql_connect('localhost', 'usuario', 'clave'); if (!$link) { die('Could not connect to MySQL server: ' . mysql_error()); } $dbname = 'db'; $db_selected = mysql_select_db($dbname, $link); if (!$db_selected) { die('Could not set $dbname: ' . mysql_error()); } $query = "select nombre,telefono from agenda "; $res = mysql_query ($query); $numfields = mysql_num_fields ($res); echo "<table> \n <tr>"; for ($i=0; $i < $numfields; $i++){ echo "<th>" .mysql_field_name ($res, $i). "</th>"; } echo "</tr> \n"; while ($row = mysql_fetch_row ($res)) {echo "<tr><td>" .implode ($row, "</td><td>"). "</td></tr> \n"; } echo "</table> \n"; ?>