Jump to content


Photo

Query not Working quite right.....


  • Please log in to reply
2 replies to this topic

#1 Nightseer

Nightseer
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 28 September 2006 - 05:12 AM

I am very new to this, and have run iunto a roadblock trying to make my site more secure. The query works like this:

mysql_query("UPDATE core SET daysleft=daysleft-1 WHERE core='$core'")
or die ('cannot subtract days');

But when I try to add the account owner to it, it stops working. The variable is correct-checked it by having it echo before it tries to query--

mysql_query("UPDATE core SET daysleft=daysleft-1 WHERE core='$core' AND ownerid='$mid'")
or die ('cannot subtract days');

The way it is now, anyone can subtract days from someone else's account-I could really use some help here ???

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 28 September 2006 - 02:47 PM

When you say "stops working", I assume you mean the table isn't updated... Since there's no syntax error, I have to conclude that there are no matching rows.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 Nightseer

Nightseer
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 28 September 2006 - 04:58 PM

Figured it out-ownerid wasn't updating right (despite echoing correctly????) Just got it fixed about ten minutes ago:) Thanks for trying!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users