View Single Post
Old 12-09-2007, 03:56 PM   #3 (permalink)
Geert
The Contributor
RegEx Guru 
 
Join Date: Dec 2007
Location: Belgium
Posts: 60
Thanks: 6
Geert is on a distinguished road
Default

Alternatively, you could use the mysql_data_seek function.

PHP Code:
$res "SELECT COUNT(*) as count, table_traffic.* FROM table_traffic, table_traffic2ip WHERE table_traffic.traffic_id=table_traffic2ip.traffic_id AND table_traffic.traffic_status='1' GROUP BY table_traffic.traffic_id ORDER BY count DESC LIMIT 20";

$list_traffic mysql_query($res) or die(mysql_error());

// Looping once
while($row mysql_fetch_array($list_traffic)){                    
    echo 
"<a href='".$row['traffic_url']."' class='popular_tags' target='_blank'>".$row['traffic_title']."</a>";
}

// Resetting internal pointer
mysql_data_seek($list_traffic0);

// And looping again!
while($row mysql_fetch_array($list_traffic)){                    
    echo 
"<a href='".$row['traffic_url']."' class='popular_tags' target='_blank'>".$row['traffic_title']."</a>";

__________________
Kohana - PHP5 framework
Geert is offline  
Reply With Quote