Hi,

I am looking for this page to display both the text and matching image. The text is coming from match table and the image from gallery, both linked via image title.

Not sure if i am joining it correctly as i am getting 'parse error' on the 2nd last line. Any helps please???

Thanks

$image_path = '/Glen/Images/'; 

$query  = "SELECT teams.match, date.match, score.match, content.match, name.gallery
FROM match
INNER JOIN gallery
ON match.imagetitle=gallery.imagetitle
ORDER BY match.date ASC";

$result = mysql_query($query);

while(list($teams, $date,$score,$content,$name )= mysql_fetch_row($result))
{
  echo " "$teams" . "$date" . "$score" .
 <img class="image" src="$image_path['name']"/> .  "$content";
}

what you've done in the second last line is just a simple syntactical error in concatenating strings and php variables in one line

Below pasted code is just one of several possible ways to handle this

$image_path = '/Glen/Images/';

$query = "SELECT teams.match, date.match, score.match, content.match, name.gallery
FROM match
INNER JOIN gallery
ON match.imagetitle=gallery.imagetitle
ORDER BY match.date ASC";

$result = mysql_query($query);

while(list($teams, $date, $score, $content, $name )= mysql_fetch_row($result))
{
echo $teams. " - " .$date . " - ".$score ." -<img class='image' src='{$image_path['name']}'/>".$content;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.