Jump to content

Archived

This topic is now archived and is closed to further replies.

chico1st

join syntax

Recommended Posts

Hey im having trouble with a join, as far as i can figure it should work but i get:
[b]Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\Lib.php on line 206[/b]

this worked fine before i tried to join it so i think that must be the problem

[b]$query = "SELECT news.newsID, news.pictureID, news.dateID, news.name, news.abstract, date.dateID, date.name " .
  "FROM news, date WHERE news.dateID = date.dateID ORDER date.name";[/b]

$result = mysql_query($query, $dbConn);

 
  //print 2 most recent news articles
  for( $i = 0; $i <2; $i++){
$output .= "\n<tr><td>";
$row = mysql_fetch_assoc($result);
        $news_id = $row['news.newsID'];
$name = $row['news.name'];
$abstract = $row['news.abstract'];
$image_id = $row['news.pictureID'];
      ....

any help you can offer would be GGGGGRRREEAT!

Share this post


Link to post
Share on other sites
Perhaps... also, you should write JOINs using the proper syntax, without using the comma operator.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.