query
| From: | JAO | Date: | Thu, 24 Jan 2002 12:29:37 +0000 |
| Subject: | query | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-22036@lists.php.net to get a copy of this message | ||
Hola PHPES,
Soy nuevo en esto del PHP, estoy haciendo unas pruebas de un query
para hacer comentarios, pero por alguna razón no entran los
registros, les mando el codigo para ver en donde me equivoco
<?
$lugar = "localhost";
$nombre = "login";
$pass = "pass";
$db = "test";
$conexion = mysql_connect($lugar, $nombre, $pass);
mysql_select_db($db, $conexion);
$query = "SELECT * FROM guestbook ORDER BY id ASC";
$resultado = mysql_query($query, $conexion);
while ($row = mysql_fetch_array($resultado)) { //Mientras exista una consulta
$nombre = $row["nombre"];
$mail = $row["emilio"];
$ciudad = $row["cd"];
$http = $row["http"];
$texto = $row["texto"];
echo "$nombre, $mail, $ciudad, $http, $texto"; }
mysql_free_result($resultado);
echo "<form enctype=multipart/form-data method=POST action=$PHP_SELF>
<p><strong><font size=1>* Tu nombre o Nick</font></strong><br>
<input type=text name=nombre size=30>
<br>
<strong><font size=1>* Tu Dirección de correo electrónico</font></strong>
<br>
<input type=text name=emilio size=36>
<br>
<strong><font size=1>Tu ciudad</font></strong>
<br>
<input type=text name=cd size=36>
<br>
<strong><font size=1>Tu Pagina</font></strong>
<br>
<input type=text name=http size=36>
<br>
<strong><font size=1>Texto</font></strong>
<br>
<input type=text name=texto size=36>
<br>
</font></strong>
<br>
<input type=submit name=submit value=ENVIAR>
</font>
<input type=reset>
<br>
</p>
</form>";
?>
Saludos
JAO