Jump to content

[SOLVED] -1 in Mysql


LostKID

Recommended Posts

How do i remove -1 in Mysql via php in a query.. Basically i count how many posts the user has made.. it gets added onto their users information.. so i just comments=comments+1 when im adding to their table but tried using comments=comments-1 and it didnt work..

 

heres the query im using:

 

$query7 = "UPDATE josh_users SET comments=-1 WHERE email='$vemail'";
$result7 = mysql_query($query7) or die (mysql_error());

Link to comment
Share on other sites

nvm i realised that i didnt call in the $vemail to check where to delete it from.. before i used comment=comment-1 but it didnt work so i tried comments=-1 and i guess thats when i last saved it

so i changed it back to comments=comments-1 pulled in the email address for the logged user to $vemail so it knew where to delete it from lmao.. sorry thanks for your help though :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.