Jump to content

pezkingrich2

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pezkingrich2's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. problem solved! UPDATE users SET comments=comments+1 WHERE username=\'$username\' I couldn\'t get it to add 1 in php, but this works in mysql. Thanks for your help mod.
  2. ok, i feel kinda stupid now, thanks! apart from...... the post count doesn\'t achually update. It seems to stick on 7.
  3. ahh, i knew that.. thanks, but still not solved, now the error is: You have an error in your SQL syntax near \'WHERE username=Rich\' at line 1[/b]
  4. I\'m trying to add one to the \'comment count\' when someone submits a comment! The sql error i get is: You have an error in your SQL syntax near \'INSET INTO users (comments) VALUES (\'7\') WHERE username=\'Rich\'\' at line 1 Code: $get_comment = mysql_query(\"SELECT comments FROM users WHERE username=\'$username\'\") or die(mysql_error()); $new_comment = $get_comment++; mysql_query(\"INSET INTO users (comments) VALUES (\'\".$new_comment.\"\') WHERE username=\'$username\'\") or die(mysql_error()); echo \"Comment entered. Thanks!<BR>n\"; The comment value is stored in the databse as an INTEGER. I tried echoing the values, for $new_comment i get \'7\' and for $get_comment i get \'Resource id #6\' . Ahh wht am i doing wrong?! (i manually entered the value 5 for comments).
×
×
  • Create New...

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.