Cita:
Y al cargar esta página aparece esto: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include("configuracion.php");
global $conexion;
conectar();
$sql=("SELECT * FROM 902Datosgenerales" );
$result=mysql_query($sql,$conexion);
?>
<p><table border="1" cellspacing="0" cellpadding="0" bordercolor="black" width="30%">
<tr>
<td><strong>Empresa</strong></td>
<td><strong>Dirección</strong></td>
<td><strong>C.P.</strong></td></tr>
<?php
//abrimos de nuevo y mostramos registros
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><?=$row["empresa"]?></td>
<td><?=$row["direccion"]?></td>
<td><?=$row["codigo_postal"]?></td>
</tr>
<?
}
//cerramos php, cerramos tabla y creamos una tabla con 2 columnas
?>
</table>
</body>
</html>
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include("configuracion.php");
global $conexion;
conectar();
$sql=("SELECT * FROM 902Datosgenerales" );
$result=mysql_query($sql,$conexion);
?>
<p><table border="1" cellspacing="0" cellpadding="0" bordercolor="black" width="30%">
<tr>
<td><strong>Empresa</strong></td>
<td><strong>Dirección</strong></td>
<td><strong>C.P.</strong></td></tr>
<?php
//abrimos de nuevo y mostramos registros
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><?=$row["empresa"]?></td>
<td><?=$row["direccion"]?></td>
<td><?=$row["codigo_postal"]?></td>
</tr>
<?
}
//cerramos php, cerramos tabla y creamos una tabla con 2 columnas
?>
</table>
</body>
</html>
Conexión establecida
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Apache2\htdocs\sitio\ver_todos.php on line 28
Empresa Dirección C.P.
Xq me da todo el rato error en el array? Y no me sale ningun dato. Muchas gracais.