I'm not sure if this is what he wanted, I understood this was about inserting a line whenever the char_clan changes.
If I'm right: use a variable to keep track of the current char_clan, e.g.
mysql_connect($dbhost, $dbuser, $dbpasswd)
or die("Unable to connect to SQL server");
$result_c = mysql_db_query("blah", "SELECT * FROM " .$table_prefix. "blah ORDER BY char_clan ASC")
or die("Unable to select Database 1");
$row_c = mysql_num_rows($result_c);
while ($row_c = mysql_fetch_array($result_c)) {
$record_id = $row_c["record_id"];
$user_id_r = $row_c["user_id"];
$char_email = $row_c["char_email"];
$char_name = $row_c["char_name"];
// compare the value of the current row to the previous one
if ($row_c["char_clan"]!=$char_clan){
// output a line
echo "<hr />\n";
// we only need to reassign the variable if it was different
$char_clan = $row_c["char_clan"])
}
$char_sect = $row_c["char_sect"];
$char_status = $row_c["char_status"];
$char_prestige = $row_c["char_prestige"];
$char_ccond = $row_c["char_ccond"];
$char_bg = $row_c["char_bg"];
if ($row_c["char_anti"] == '1')
{
$char_anti = "<i>antitribu</i>";
}
else
{
$char_anti = "";
}
// other stuff and output...
} // end of while loop
This would create an additional line above the first record since the variable is not set yet, but might give you an idea.