Hola a todos, he vuelto después de un parentesis obligado por sobrecarga de trabajo.
Alguien me envío una solución a mi problema y le doy las gracias, copie textualmente las instrucciones que medio y persiste el problema, solicito su ayuda por favor.
Parse error: syntax error, unexpected '>' in C:\xampp\htdocs\www\09_CONSULTAS_SELECT_TABLA_AGENDA_GENTE.php on line 14
<html>
<body>
<?php
$db = mysql_connect('localhost', 'root', '') or die("No se puede establecer la conexión con la base de datos");
mysql_select_db("agenda", $db);
$result = mysql_query("SELECT nombre, apellidos FROM gente", $db);
if ($row = mysql_fetch_array($result)){
echo "<table style=\"border: 4px red dotted;\" border=\"1\"> \n
<tr> \n
<td><b>Nombre</b></td> \n
<td><b>Apellido</b></td> \n;
</tr> \n;
do {
echo "<tr> \n <td>".$row["nombre"]."</td> \n"
<td>".$row["apellidos"]."</td>\n"
</tr> \n";
} while ($row = mysql_fetch_array($result));
echo "</table>\n
</table> \n";
} else {
echo "No se encontraron registros";
}
mysql_free_result($result);
mysql_close($db);
?>
</body>
</html>
Primer error:
if ($row = mysql_fetch_array($result)){
echo "<table style=\"border: 4px red dotted;\" border=\"1\"> \n
<tr> \n
<td><b>Nombre</b></td> \n
<td><b>Apellido</b></td> \n;
</tr> \n;
do {
Aquí te falta cerrar las comillas dobles!
if ($row = mysql_fetch_array($result)){
echo "<table style=\"border: 4px red dotted;\" border=\"1\"> \n
<tr> \n
<td><b>Nombre</b></td> \n
<td><b>Apellido</b></td> \n;
</tr> \n";
do {
No busque más errores. :xD
Gracias Alex@ShellRoot.
Realice el cambio que me indicaste y me envía el mismo mensaje en otra linea.
Parse error: syntax error, unexpected '>' in C:\xampp\htdocs\www\09_CONSULTAS_SELECT_TABLA_AGENDA_GENTE.php on line 16
<html>
<body>
<?php
$db = mysql_connect('localhost', 'root', '') or die("No se puede establecer la conexión con la base de datos");
mysql_select_db("agenda", $db);
$result = mysql_query("SELECT nombre, apellidos FROM gente", $db);
if ($row = mysql_fetch_array($result)){
echo "<table style=\"border: 4px red dotted;\" border=\"1\"> \n
<tr> \n
<td><b>Nombre</b></td> \n
<td><b>Apellido</b></td> \n;
</tr> \n";
do {
echo "<tr> \n
<td>".$row["nombre"]."</td> \n"
<td>".$row["apellidos"]."</td> \n"
</tr> \n";
} while ($row = mysql_fetch_array($result));
echo "</table> \n
</table> \n";
} else {
echo "No se encontraron registros";
}
mysql_free_result($result);
mysql_close($db);
?>
</body>
</html>
Segundo error:
do {
echo "<tr> \n
<td>".$row["nombre"]."</td> \n"
<td>".$row["apellidos"]."</td> \n"
</tr> \n";
} while ($row = mysql_fetch_array($result));
Error en las comillas dobles
do {
echo "<tr> \n
<td>".$row["nombre"]."</td> \n
<td>".$row["apellidos"]."</td> \n
</tr> \n";
} while ($row = mysql_fetch_array($result));
No busque más errores. :xD
Saludos!
Gracias Alex@ShellRoot.
Excelente, ya funciono ..... muy agradecido.