SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Error Message

  1. #1
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error Message

    Hiya Guys,

    Why do I keep getting greeted with the following message?:

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in
    C:\Documents and Settings\Dale Piper\Desktop\Xampp\htdocs\Photo Gallery\Display.php on line 23

    Code PHP:
    <link rel="stylesheet" type="text/css" href="Index.css" />
    <script src="Thumbnails.js"></script>
     
    <?php
    $con = mysql_connect("localhost","peter","abc123");
    if (!$con)
    {
      die('Could not connect: ' . mysql_error());
    }
     
    mysql_select_db("Gallery", $con);
     
    $result = mysql_query("SELECT * FROM Images");
     
    echo '<div id="Scroller">';
     
    while($row = mysql_fetch_array($result))
    {
      echo '<img class="Thumbnails" src="' . $row['Path'] . '" />';
      echo $row['Caption'];
    }
     
    echo '</div>';
     
    echo '<img src="../../images/nav/tri-lft.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(-4, 'h');" onmouseout="stopScroll();">';
    echo '<img src="../../images/nav/tri-rt.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(4, 'h');" onmouseout="stopScroll();">';
     
    mysql_close($con);
    ?>

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the problem seems to be here:

    PHP Code:
    echo '<img src="../../images/nav/tri-lft.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(-4, 'h');" onmouseout="stopScroll();">';
    echo 
    '<img src="../../images/nav/tri-rt.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(4, 'h');" onmouseout="stopScroll();">'
    If you notice you have you php echo surrounded by 's and then you have:

    onmouseover="scrollDiv(4, 'h');" in the middle of the line, effectively terminating the echo statement

  3. #3
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dc dalton View Post
    the problem seems to be here:

    PHP Code:
    echo '<img src="../../images/nav/tri-lft.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(-4, 'h');" onmouseout="stopScroll();">';
    echo 
    '<img src="../../images/nav/tri-rt.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(4, 'h');" onmouseout="stopScroll();">'
    If you notice you have you php echo surrounded by 's and then you have:

    onmouseover="scrollDiv(4, 'h');" in the middle of the line, effectively terminating the echo statement
    What needs to be changed, in order to avoid this?

  4. #4
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    echo '<img src="../../images/nav/tri-lft.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(-4, \'h\');" onmouseout="stopScroll();">';
    echo 
    '<img src="../../images/nav/tri-rt.gif" width="12" height="12" alt="" border="0" onmouseover="scrollDiv(4, \'h\');" onmouseout="stopScroll();">'
    notice the escapes around your h's


Bookmarks

Posting Permissions

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