Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    311
    Thanks
    0
    Thanked 1 Time in 1 Post

    Help with This code

    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 Code:
    <?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?

  • #2
    New Coder
    Join Date
    Apr 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would help us if you tell us which one of these lines is line 144 so we'll know the exact line.

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post
    I'll take a guess that it is this line?

    PHP Code:
                        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.

  • #4
    New Coder
    Join Date
    Nov 2006
    Location
    UK
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Or

    Change:
    Code:
    echo '<a href="view_video.php?id='$videolink'">'.$Video['video_title'];Echo '</a>';
    To:
    Code:
    echo '<a href="view_video.php?id=$videolink">'.$Video['video_title'];Echo '</a>';
    - Mark

  • #5
    Regular Coder
    Join Date
    Apr 2007
    Posts
    295
    Thanks
    0
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by Linark View Post
    Or

    Change:
    Code:
    echo '<a href="view_video.php?id='$videolink'">'.$Video['video_title'];Echo '</a>';
    To:
    Code:
    echo '<a href="view_video.php?id=$videolink">'.$Video['video_title'];Echo '</a>';
    Then it won't parse $videolink

    Change that line to
    PHP Code:
    echo '<a href="view_video.php?id='$videolink .'">'$Video['video_title'] .'</a>'


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •