why does it loop more then once…am i missing something

befriend

New Member
There is only one record in the table so why does it loop like i have 5 table with one letter each\[code\]$query = "Select * from click_tracker";$result = mysql_query($query);$all_clicks = mysql_fetch_array($result);foreach($all_clicks as $click){ print " <table border=\"1\"> <tr> <th>Location</th> <th>Visit Count</th> </tr> <tr> <td>{$click['url_destination']}</td> <td>{$click['count']}</td> </tr> </table>";}\[/code\]here is the table returned\[code\]<table border="1"> <tr> <th>Location</th> <th>Visit Count</th> </tr> <tr> <td>2</td> <td>2</td> </tr></table><table border="1"> <tr> <th>Location</th> <th>Visit Count</th> </tr> <tr> <td>2</td> <td>2</td> </tr></table><table border="1"> <tr> <th>Location</th> <th>Visit Count</th> </tr> <tr> <td>h</td> <td>h</td> </tr></table><table border="1"> <tr> <th>Location</th> <th>Visit Count</th> </tr> <tr> <td>h</td> <td>h</td> </tr></table><table border="1"> <tr> <th>Location</th> <th>Visit Count</th> </tr> <tr> <td>5</td> <td>5</td> </tr></table><table border="1"> <tr> <th>Location</th> <th>Visit Count</th> </tr> <tr> <td>5</td> <td>5</td> </tr></table> \[/code\]
 
Back
Top