Matching Different Tables' Columns and Rows

2006-04-28 Thread -Patrick
Hi,
I am having the toughest time accomplishing this. I am asking for any
examples or links to info pertaining to this as I want to make an effort
before posting any code.

After matching the specific rows by an identifying column between two
tables.. I can manipulate some data albeit on a minor scale.. instead of
finding only specifc rows that match, I'm receiving ALL rows between the
tables, so it may be more logic than querying the db. However, my
initial query to the db never seems to be correct and this may also be
the problem.

Any tips, suggestions or code examples is appreciated.
Thanks
-Patrick

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Matching Different Tables' Columns and Rows

2006-04-28 Thread -Patrick
Basically, I want to match specific rows with ONLY a specific date.

Here's the code:
mysql_select_db($database_connBlog, $connBlog);
$query_FindArticleDates = SELECT * FROM blg_article_art, blg_topic_top
WHERE blg_article_art.idtop_art = blg_topic_top.id_top;
$findArticleDates = mysql_query($query_FindArticleDates, $connBlog) or
die(mysql_error());
$findRow_ArticleDates = mysql_fetch_assoc($findArticleDates);
$field_ArticleDates = mysql_fetch_array($findArticleDates);
$totalRows_FindArticleDates = mysql_num_rows($findArticleDates);

?php for ( $k = $totalRows_FindArticleDates; $k  0; $k-- ) {
  if (mysql_num_rows($findArticleDates)  0){
  mysql_data_seek($findArticleDates,0);
  while($findRow_ArticleDates =
mysql_fetch_assoc($findArticleDates)){
$dates[] = $findRow_ArticleDates['FindArticleDate'];
  }
  } ?
   a href = weblog/month.php??php echo m=$j#38;y=$year?
? echo $getMonth[$i++]. .$year; $j++; }?/a

It is supposed to print the month only IF it there is entries matching
the date. So if there were 3 entries made for one month, then all
entries for that month should be printed. Right now, this prints every
row in existence.

-Patrick


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]