while( ($cat = mysqli_fetch_assoc($result)) )
{
if ($articles_count = mysqli_query($conection, "SELECT * FROM `articles` WHERE `categories_id`='".mysqli_real_escape_string($connection, $cat['id'])."'"))
{
echo '<li>' . $cat['name'] . ' ('. mysqli_num_rows($articles_count).') </li>';
}
}
mysqli_real_escape_string()
). .replace(/.*?([A-Z]+) +([A-Z]+).*/, '$1 $2')
.replace(/^ +|[^A-Z ]/g, '').replace(/ +(\w*).*/, ' $1')