Jump to content


Photo

unexpected T_STRING error


  • Please log in to reply
1 reply to this topic

#1 JEB

JEB
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 23 April 2006 - 10:22 AM

I've got a SQL db running on my web server and I wanted to query some records in it back to a web page. I'm using MX V6.0. I can connect to my site & DB ok, can see the tables, and have created a Recordset. I've dragged a field from the recordset onto my web page, and when I try to preview it I get the following error:-

Parse error: parse error, unexpected T_STRING in /home/craftyiorg/public_html/TMP4kp26y67bj.php on line 5

My full code is:-

<?php require_once('Connections/Test.php'); ?>
<?php
mysql_select_db($database_Test, $Test);
$query_TestMatches = "SELECT MatchID, MatchTypeID, MatchSeasonID, MatchDateTime, MatchOpponent, MatchPlaceID, MatchStadium, MatchReferee, MatchGoals, MatchGoalsOpponent FROM tplss_matches ORDER BY MatchDateTime ASC";
$TestMatches = mysql_query($query_TestMatches, $Test) or die(mysql_error());
$row_TestMatches = mysql_fetch_assoc($TestMatches);
$totalRows_TestMatches = mysql_num_rows($TestMatches);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php echo $row_TestMatches['MatchID']; ?>
</body>
</html>
<?php
mysql_free_result($TestMatches);
?>

My connection is called 'test', and my Recordest is called 'TestMatches'.

I've also tried saving the .php file and ftping it onto my webspace, but it won't run from there either.

Has anyone got any ideas what may be causing this please?

#2 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 15 May 2006 - 03:15 PM

try commenting your variable declarations with two front slashes // one line at a time. If you've got a carriage return in there somewhere, the whole "line" of code won't turn yellow. Carriage return will cause that error.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users