Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/09/2003, 18:58
Avatar de mapper
mapper
 
Fecha de Ingreso: enero-2003
Ubicación: Argentina
Mensajes: 321
Antigüedad: 21 años, 3 meses
Puntos: 1
un do while en un mail?

hola, lo que necesito hacer es muy simple (Creo yo) pero no lo logro hacer. necesito insertar el bucle que esta a continuacion en un mail.

Código PHP:
<?php require_once('Connections/intercambio.php'); ?>
<?php
$maxRows_mail 
10;
$pageNum_mail 0;
if (isset(
$HTTP_GET_VARS['pageNum_mail'])) {
  
$pageNum_mail $HTTP_GET_VARS['pageNum_mail'];
}
$startRow_mail $pageNum_mail $maxRows_mail;

$colname_mail "1";
if (isset(
$HTTP_GET_VARS['categoria'])) {
  
$colname_mail = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['categoria'] : addslashes($HTTP_GET_VARS['categoria']);
}
mysql_select_db($database_intercambio$intercambio);
$query_mail sprintf("SELECT * FROM intercambio_urls WHERE categoria = '%s' AND validado = 'v' ORDER BY estrellas DESC"$colname_mail);
$query_limit_mail sprintf("%s LIMIT %d, %d"$query_mail$startRow_mail$maxRows_mail);
$mail mysql_query($query_limit_mail$intercambio) or die(mysql_error());
$row_mail mysql_fetch_assoc($mail);

if (isset(
$HTTP_GET_VARS['totalRows_mail'])) {
  
$totalRows_mail $HTTP_GET_VARS['totalRows_mail'];
} else {
  
$all_mail mysql_query($query_mail);
  
$totalRows_mail mysql_num_rows($all_mail);
}
$totalPages_mail ceil($totalRows_mail/$maxRows_mail)-1;
?>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php do { ?>
&quot;<?php echo $row_mail['numero']; ?>&quot;,&quot;<?php echo $row_mail['categoria']; ?>&quot;,&quot;<?php echo $row_mail['descripcioncorta']; ?>&quot;,&quot;<?php echo $row_mail['direccion']; ?>&quot; 
<?php } while ($row_mail mysql_fetch_assoc($mail)); ?>
</body>
</html>
<?php
mysql_free_result
($mail);
?>
Ya que estoy les doy la estructura de la tabla.

CREATE TABLE `intercambio_urls` (
`id` int(10) NOT NULL auto_increment,
`numero` int(3) NOT NULL default '0',
`direccion` varchar(100) NOT NULL default '',
`descripcioncorta` varchar(50) NOT NULL default '',
`estrellas` int(1) NOT NULL default '0',
`categoria` varchar(30) NOT NULL default '',
`autor` varchar(50) NOT NULL default '',
`fecha` int(10) NOT NULL default '0',
`validado` char(1) NOT NULL default 'f',
`ip` varchar(30) NOT NULL default '',
UNIQUE KEY `direccion` (`direccion`),
KEY `id` (`id`),
KEY `categoria` (`categoria`),
KEY `validado` (`validado`)
) TYPE=MyISAM AUTO_INCREMENT=26 ;


Espero que me puedan ayudar. ahh ya que estoy les doy el formato de el mail donde lo inserto.

Código PHP:
<?php
$sfrom
="[email protected]"//cuenta que envia
$sdestinatario="[email protected]"//cuenta destino
$ssubject="Listado de galerias"//subject
$shtml=""//mensaje
$sheader="From:".$sfrom."\nReply-To:".$sfrom."\n";
$sheader=$sheader."X-Mailer:PHP/".phpversion()."\n";
$sheader=$sheader."Mime-Version: 1.0\n";
$sheader=$sheader."Content-Type: text/html";
mail($sdestinatario,$ssubject,$shtml,$sheader);
?>
Please ayudenmeeeeE!
__________________
-- May The Force Be With You --