Well perhaps the problem im having is to do with the SQL??? i dunno, ive been tryin to get it to work for a while now,,,ive been usin php for quiet a while now,,,but this is just so,,,argghhh haha well below is the actual php page, with all the code, hav a look at the sql where i use COUNT maybe there is a problem there???
Code:
//db connection
<?php require_once('../Connections/MYDB.php'); ?>
//Create Record Set (only Dreamweaver code here)
<?php
mysql_select_db($database_MYDB, $MYDB);
$query_rsAllDisplayTags = "SELECT tags, COUNT(title) FROM tblarticles GROUP BY tags";
$rsAllDisplayTags = mysql_query($query_rsAllDisplayTags, $MYDB) or die(mysql_error());
$row_rsAllDisplayTags = mysql_fetch_assoc($rsAllDisplayTags);
$totalRows_rsAllDisplayTags = mysql_num_rows($rsAllDisplayTags);
?>
//End Record Set
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>work darn u</title>
<link href="../CSS/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
</div>
<div id="content">
<div id="maincloudall">
//This determines how $tagstyle should be used, ex: if the COUNT of title is > 8 the $tagstyle is = "cloudsmall2font" and $tagstyle is used later on.
<?
if ($row_rsAllDisplayTags['COUNT(title)'] > 0) $tagstyle = "cloudtinyfont";
if ($row_rsAllDisplayTags['COUNT(title)'] > 3) $tagstyle = "cloudtiny2smallfont";
if ($row_rsAllDisplayTags['COUNT(title)'] > 5) $tagstyle = "cloudsmallfont";
if ($row_rsAllDisplayTags['COUNT(title)'] > 8) $tagstyle = "cloudsmall2font";
if ($row_rsAllDisplayTags['COUNT(title)'] > 10) $tagstyle = "cloudmediumfont";
if ($row_rsAllDisplayTags['COUNT(title)'] > 13) $tagstyle = "cloudmedium2font";
if ($row_rsAllDisplayTags['COUNT(title)'] > 15) $tagstyle = "cloudmedium3font";
?>
// variable $tabcound is equal to the count of "title"
<? $tagcount = $row_rsAllDisplayTags['COUNT(title)']; ?>
//Explode the row 'tags' from the db, explode at comma
<? $exploded_tags = explode(', ', $row_rsAllDisplayTags['tags']); ?>
//For each of the tags now exploded, create an array and echo....
<? foreach ($exploded_tags as $tagexplodearray) { echo ("<a href='/Tags/$tagexplodearray' rel='tag' class='$tagstyle'>$tagexplodearray ($tagcount)</a> ");} ?>
<?php } while ($row_rsAllDisplayTags = mysql_fetch_assoc($rsAllDisplayTags)); ?>
</div>
</body>
</html>
<?php
mysql_free_result($rsAllDisplayTags);
?
TIA
Bookmarks