foevah Posted May 20, 2007 Share Posted May 20, 2007 I have a table called comments and a field inside this table called entry. One of the values in the entry field is 7 but I want it to change to 3. I have another field called ID where entry 7 (the one I am trying to change) has the ID of 20. Basically something like this: where id=20 change entry=7 to 3 The line of code below is is what I have tried to use to change the ID of this entry but it didnt work (I have tried other variations). $result = mysql_query("UPDATE php_blog_comments SET entry='3' WHERE entry=7; ") or print ("Can't update entry.<br />" . mysql_error()); In the browser it says query was empty I want to change entry 7 to entry 3. Is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/52254-how-to-change-an-entry-number/ Share on other sites More sharing options...
chigley Posted May 20, 2007 Share Posted May 20, 2007 <?php $q = mysql_query("UPDATE php_blog_comments SET entry = 3 WHERE id = 20") or die(mysql_error()); ?> Quote Link to comment https://forums.phpfreaks.com/topic/52254-how-to-change-an-entry-number/#findComment-257807 Share on other sites More sharing options...
foevah Posted May 20, 2007 Author Share Posted May 20, 2007 excellent thank you chigley!! Quote Link to comment https://forums.phpfreaks.com/topic/52254-how-to-change-an-entry-number/#findComment-257814 Share on other sites More sharing options...
chigley Posted May 20, 2007 Share Posted May 20, 2007 No problem Remember to click solved. Quote Link to comment https://forums.phpfreaks.com/topic/52254-how-to-change-an-entry-number/#findComment-257815 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.