Its always the simplest things...
I moved the sql stuff for the news into the first while loop, and it
seems good.
Thanks for waking me up...
Steve Cayford wrote:
> On your first email you loop through all the news in the $newsfetch
> resource. I think you need to then do a mysql_data_seek() c
On your first email you loop through all the news in the $newsfetch
resource. I think you need to then do a mysql_data_seek() call against
that to reset it for the next time through the loop. Otherwise you'll
just get a null result because you're already at the end of the data.
-Steve
On Wedn
You only want to retrieve the news from your table once.
So, pull pull this code:
> $container[] = $message;
> while (list($news, $date) = mysql_fetch_row($newsfetch)) {
> $container[] = '' . $news . '';
> $container[] = '';
> }
> $container[] = '';
outside of (before) this loop:
(made a correction in sudo code)
Ok, this one is breaking my back all day.
First some sudo-code ->
fuction email_to_user() {
$sql = 'select distinct(email) from user';
$emailfetch = mysql_query($sql);
$sql = 'select news, date from news order by sid desc limit 10';
$news
Ok, this one is breaking my back all day.
First some sudo-code ->
fuction email_to_user() {
$sql = 'select distinct(email) from user';
$emailfetch = mysql_query($sql);
$sql = 'select news, date from news order by sid desc limit 10';
$newsfetch = mysql_query($sql);
while
5 matches
Mail list logo