ok, here is my troublemaker code, for some reason when i echo the $catlist it prints the last record twice.
however, when i try to echo $catslist (which does not exist) insead of $catlist i get the right results (amazin!)
how can i fix it? what is wrong?
<?
include ("config.php");
$id="$catstr";
$connection = mysql_connect($hostname, $user, $pass) or die ("Unable to connect!");
$query = "SELECT DISTINCT cat_id, name, mas_cat_id from ds_categories WHERE ds_categories.mas_cat_id='$id'";
$result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error());
echo "<table width=100% align=left><tr>";
$tick = 1;
while(list($cat_id, $name, $mas_cat_id) = mysql_fetch_row($result))
{
$catlist="<td><a href=/index.php3?catstr=$cat_id>$name</a></td>";
echo "$catlist";
if ($tick % 3 == 0) {
echo "</tr><tr>";
}
$tick++;
}
mysql_close($connection);
?>