Jump to content


Photo

What the???


  • Please log in to reply
6 replies to this topic

#1 dragonusthei

dragonusthei
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 04 October 2006 - 11:15 PM

Im having a really hard time with a problem.

I want my shopping cart to check if the items added to cart is greater than those currently in stock i ran the query in phpadmin to see why it wasnt working but


Posted Image

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 04 October 2006 - 11:22 PM

What's the problem?

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 04 October 2006 - 11:24 PM

his query returned a record where the stock was greter than the number requested!

acoding to his pic anyway!
follow me on twitter @PHPsycho

#4 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 04 October 2006 - 11:27 PM

Odd, as the same image says showing rows 0 to 0

Hmmmm, Interesting!  If you want to provide a sql dump of the table I'll load it into my version of phpMyAdmin and see if I get the same results.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#5 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 04 October 2006 - 11:33 PM

What field types are item_qty and item_stock?

#6 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 04 October 2006 - 11:37 PM

WELL SPOTTED!

Looks like text to me - change them to ints!
follow me on twitter @PHPsycho

#7 dragonusthei

dragonusthei
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 05 October 2006 - 09:03 PM

Thank you, changed them to ints and it works perfect :D

Thanks guys




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users