bilis_money Posted July 12, 2006 Share Posted July 12, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/14384-parse-error-syntax-error-unexpected-t_lnumber-where-i-cant-see-the-bug/ Share on other sites More sharing options...
obsidian Posted July 12, 2006 Share Posted July 12, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/14384-parse-error-syntax-error-unexpected-t_lnumber-where-i-cant-see-the-bug/#findComment-56749 Share on other sites More sharing options...
kenrbnsn Posted July 12, 2006 Share Posted July 12, 2006 You're missing the closing double quote on this line:[code]<?php $query = "UPDATE photos SET comments='$comment_tmp' WHERE id='91';?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/14384-parse-error-syntax-error-unexpected-t_lnumber-where-i-cant-see-the-bug/#findComment-56751 Share on other sites More sharing options...
bilis_money Posted July 12, 2006 Author Share Posted July 12, 2006 thank u for your relentless help.i hope i can pay you back someday. Quote Link to comment https://forums.phpfreaks.com/topic/14384-parse-error-syntax-error-unexpected-t_lnumber-where-i-cant-see-the-bug/#findComment-56758 Share on other sites More sharing options...
sasa Posted July 12, 2006 Share Posted July 12, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/14384-parse-error-syntax-error-unexpected-t_lnumber-where-i-cant-see-the-bug/#findComment-56838 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.