godsent Posted March 20, 2009 Share Posted March 20, 2009 I need your help everyone. I understand how this works. mysql_query("UPDATE list SET bans = bans+1 WHERE name ='$nick'"); And what im trying to do is: where is row called "comments", and I wan to add new comment in the same row with existing old comment. Its a comments for every user, and im not sure how to do that exactly. Any ideas please? Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted March 20, 2009 Share Posted March 20, 2009 do you mean... <?php $query = mysql_query("INSERT INTO `something` (comment) VALUES('".$comment."')") or die(mysql_error()); ? Regards, ACE Quote Link to comment Share on other sites More sharing options...
godsent Posted March 20, 2009 Author Share Posted March 20, 2009 I mean to update the row with old value + new value. Quote Link to comment Share on other sites More sharing options...
irkevin Posted March 20, 2009 Share Posted March 20, 2009 are you using a form for that? Quote Link to comment Share on other sites More sharing options...
godsent Posted March 20, 2009 Author Share Posted March 20, 2009 yes simple form Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 20, 2009 Share Posted March 20, 2009 set a session then update the database with the new comment. <?php session_start(); // database connection. if(isset($_POST['submit'])){ $comment=mysql_real_escape_string($_POSt['comment']); $_SESSION['comment']=$comment; // insert info // if(mysql_affected_rows(the insert) // update database set comment=$_SESSIOn['comment'] WHERE id='$id' you get the drift i hope. 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.