Jump to content


Photo

Parse error: syntax error, unexpected T_LNUMBER ? where? i can't see the bug.


  • Please log in to reply
4 replies to this topic

#1 bilis_money

bilis_money
  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 12 July 2006 - 01:19 PM

hi, please help me with this i'm totally lost in these codes.

<?php

//get old comment data from table
//store old comment data into temporary variable
//if save button submitted then
//then incorporate newly inputted data
//into old data into temporary variable.
//then display combined data and form again.

	include 'include/opendb.php';
	$self = $_SERVER['PHP_SELF'];

	if (isset($_POST['action']) && $_POST['action'] == 'submitted') {
			echo $comment, "<br><br>";
			echo '<a href="'. $self .'">Please try again</a>';

		$comment_tmp = $_POST['comment'];

		$query = "UPDATE photos SET comments='$comment_tmp' WHERE id='91';
		mysql_query($query) or die('Error, insert query failed');

	} else {

	echo ('<table border="0" width="261" height="152">
		<tr>
		<td width="290" height="146">
		  <form method="POST" action=".$self.">
			<textarea rows="9" name="comment" cols="33"></textarea>
			<input type="hidden" name="action" value="submitted" />
			<input type="submit" value="Submit" name="B1">
			<input type="reset" value="Reset" name="B2">
		  </form>
		</td>
	  </tr>
	</table>');

	}
?>

and the error message was;
Parse error: syntax error, unexpected T_LNUMBER in /home/askjames/public_html/mygallery/add_comment.php on line 24

please help me i'm totally scratching my butt with this.

thank u for your kind help in advance.



#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 12 July 2006 - 01:27 PM

your error is here: you haven't closed your quotes:
<?php
$query = "UPDATE photos SET comments='$comment_tmp' WHERE id='91'";
mysql_query($query) or die('Error, insert query failed');
?>

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 12 July 2006 - 01:28 PM

You're missing the closing double quote on this line:
<?php 		$query = "UPDATE photos SET comments='$comment_tmp' WHERE id='91';?>

Ken

#4 bilis_money

bilis_money
  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 12 July 2006 - 01:48 PM

thank u for your relentless help.

i hope i can pay you back someday.

#5 sasa

sasa
  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 12 July 2006 - 05:02 PM

And in line
<form method="POST" action=".$self.">
you need to close and open single qoute
<form method="POST" action="'.$self.'">





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users