...

View Full Version : Help with This code



Jacobb123
07-10-2007, 01:37 AM
This is pretty simple but I am having problems with this area of PHP. The following code keeps giving me an error

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/jacobb2/public_html/music.php on line 144


<?php
$videoResult = mysql_query("SELECT * FROM video_members ORDER BY posted_on DESC LIMIT 3")or die("Could Not Select Newest Videos ".mysql_error());
while($Video = mysql_fetch_array($videoResult)){
if (file_exists($Video['video_thumbnail'])) {
$videoSrc = $Video['video_thumbnail'];
$videolink =$Video['id'];
} else {
$videoSrc = "videos/noPic.gif";
}
echo '<div>';
echo '<img src="'.$videoSrc.'" width="64px" height="64px" alt="" title="" style="float:left;"/>';
echo '<a href="view_video.php?id='$videolink'">'.$Video['video_title'];Echo '</a>';
echo '</p>';
echo '</div><br /><br /><br /><br />';
}
?>


Can someone help me out and tell me what I am doing wrong?

ablaye
07-10-2007, 06:17 AM
I would help us if you tell us which one of these lines is line 144 so we'll know the exact line.

zorg222
07-10-2007, 11:36 AM
I'll take a guess that it is this line?


echo '<a href="view_video.php?id='$videolink'">'.$Video['video_title'];Echo '</a>';

Probably just an editing error. Change ";Echo" to "." (obviously) and you should be set.

Linark
07-11-2007, 08:24 AM
Or

Change:

echo '<a href="view_video.php?id='$videolink'">'.$Video['video_title'];Echo '</a>';

To:

echo '<a href="view_video.php?id=$videolink">'.$Video['video_title'];Echo '</a>';

mr e
07-11-2007, 09:22 PM
Or

Change:

echo '<a href="view_video.php?id='$videolink'">'.$Video['video_title'];Echo '</a>';

To:

echo '<a href="view_video.php?id=$videolink">'.$Video['video_title'];Echo '</a>';

Then it won't parse $videolink

Change that line to


echo '<a href="view_video.php?id='. $videolink .'">'. $Video['video_title'] .'</a>';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum