Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 07-22-2007, 03:50 PM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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:
<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);
?>
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 07-22-2007, 04:04 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,166
Belisarius is on a distinguished road
You're using a single quote in your <img> tags. Specifically, the onmouseover="scrollDiv(4,'h');". The whole tag is encapsulated in a single quote, so you're ending it there, then restarting it, and it's failing the syntax check. You need to escape those interior single quotes.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 07-22-2007, 05:53 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
like this:
PHP Code:
onmouseover="scrollDiv(-4, \'h\');" 
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 03:52 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting