0

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";
}
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by jigarvyas
0

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;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.