Jump to content

Archived

This topic is now archived and is closed to further replies.

bilis_money

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

Recommended Posts

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

[code]
<?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>');

}
?>
[/code]

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

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

thank u for your kind help in advance.

Share this post


Link to post
Share on other sites
your error is here: you haven't closed your quotes:
[code]
<?php
$query = "UPDATE photos SET comments='$comment_tmp' WHERE id='91'";
mysql_query($query) or die('Error, insert query failed');
?>
[/code]

Share this post


Link to post
Share on other sites
You're missing the closing double quote on this line:
[code]<?php $query = "UPDATE photos SET comments='$comment_tmp' WHERE id='91';?>[/code]

Ken

Share this post


Link to post
Share on other sites
And in line [code]<form method="POST" action=".$self.">[/code] you need to close and open single qoute [code]<form method="POST" action="'.$self.'">[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.