Comienzo mi aprendizaje de php y comienzan las dudas claro.
Pasos que he hecho hasta ahora
Instalar wamserver 2.0
Creo una base de datos llamada inmobiliaria con el PHPmyadmin
Crear un archivo y gabaralo en c:wamp/www
<body>
<h1>Reporte de Ciudades</h1>
<table border="1">
<tr>
<td>ID Ciudad</td>
<td>Nombre</td>
</tr>
<?php
$conexion = mysql_connect('localhost', 'root', '');
mysql_select_db('inmobiliaria');
$tabla = mysql_query('SELECT * FROM ciudades');
while ($registro = mysql_fetch_array($tabla)) {
?>
<tr>
<td><?php echo $registro[‘id’]; ?></td>
<td><?php echo $registro[‘nombre’]; ?></td>
</tr>
<?php
}
mysql_free_result($tabla);
mysql_close($conexion);
?>
</table>
</body>
Me da los siguientes errores
Notice: Use of undefined constant ‘id’ - assumed '‘id’' in C:\wamp\www\curso\listadociudades1.php on line 24
Notice: Undefined index: ‘id’ in C:\wamp\www\curso\listadociudades1.php on line 24
Y ya no se seguir
Alguna ayuda
Gracias
Pasos que he hecho hasta ahora
Instalar wamserver 2.0
Creo una base de datos llamada inmobiliaria con el PHPmyadmin
Crear un archivo y gabaralo en c:wamp/www
<body>
<h1>Reporte de Ciudades</h1>
<table border="1">
<tr>
<td>ID Ciudad</td>
<td>Nombre</td>
</tr>
<?php
$conexion = mysql_connect('localhost', 'root', '');
mysql_select_db('inmobiliaria');
$tabla = mysql_query('SELECT * FROM ciudades');
while ($registro = mysql_fetch_array($tabla)) {
?>
<tr>
<td><?php echo $registro[‘id’]; ?></td>
<td><?php echo $registro[‘nombre’]; ?></td>
</tr>
<?php
}
mysql_free_result($tabla);
mysql_close($conexion);
?>
</table>
</body>
Me da los siguientes errores
Notice: Use of undefined constant ‘id’ - assumed '‘id’' in C:\wamp\www\curso\listadociudades1.php on line 24
Notice: Undefined index: ‘id’ in C:\wamp\www\curso\listadociudades1.php on line 24
Y ya no se seguir
Alguna ayuda
Gracias