
error en php
Publicado por fran (7 intervenciones) el 16/08/2007 18:41:40
Este es el codigo:
<html>
<head><title>Hola</title></head>
<?php
mysql_connect("localhost", "frean", "contrasenia") or die("No se pudo conectar: " . mysql_error());
mysql_select_db("castigos") or die("No se pudo conectarr: " . mysql_error());
$result = mysql_query("SELECT asunto FROM castigos WHERE p='1'");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("Asunto: %s", $row["asunto"]);
}
?>
</html>
Este el error:
Parse error: syntax error, unexpected T_STRING in C:\web\EasyPHP\www\prueba.php on line 6
Como lo soluciono?
<html>
<head><title>Hola</title></head>
<?php
mysql_connect("localhost", "frean", "contrasenia") or die("No se pudo conectar: " . mysql_error());
mysql_select_db("castigos") or die("No se pudo conectarr: " . mysql_error());
$result = mysql_query("SELECT asunto FROM castigos WHERE p='1'");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("Asunto: %s", $row["asunto"]);
}
?>
</html>
Este el error:
Parse error: syntax error, unexpected T_STRING in C:\web\EasyPHP\www\prueba.php on line 6
Como lo soluciono?
Valora esta pregunta


0