iainlang Posted March 11, 2008 Share Posted March 11, 2008 When trying to update a table, the following works only occasionally; it doesn't work reliably. Can anyone show me where I'm going wrong, please? // $comments_new is the data incoming from the form ; $Query="SELECT comments FROM clients WHERE id='$cli_update_id' "; $Result=mysql_db_query ($DBName, $Query, $Link); while ($Row=mysql_fetch_array ($Result)) { $comments_old=$Row[comments]; } $comments=$comments_old." <br>".$comments_new; $Query="UPDATE clients SET comments='$comments' WHERE id='$cli_update_id' "; $Result=mysql_db_query ($DBName, $Query, $Link); TIA. Quote Link to comment Share on other sites More sharing options...
haku Posted March 11, 2008 Share Posted March 11, 2008 Maybe its because mysql_db_query is deprecated. php.net has this to say: This function is deprecated, do not use this function. Use mysql_select_db() and mysql_query() instead. link Quote Link to comment Share on other sites More sharing options...
iainlang Posted March 11, 2008 Author Share Posted March 11, 2008 Nope, it can't be that becos mysql_db_query works everywhere else. I see that my query didn't make it through unscathed - I should have written - $comments=$comments_old." br_within_angle-brackets ".$comments_new; Quote Link to comment 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.