Dethman Posted January 12, 2008 Share Posted January 12, 2008 function PPT($id){ $sql="UPDATE `user_users` SET `PPT` - 1"; } any help wold b awsome ~Dethman~ Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/ Share on other sites More sharing options...
Ken2k7 Posted January 12, 2008 Share Posted January 12, 2008 function PPT($id){ $sql="UPDATE `user_users` SET `PPT`='-1'"; } You mean that? If so, what's the point of the $id parameter? Maybe: function PPT($id){ $sql="UPDATE `user_users` SET `PPT`='$id'"; } Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437102 Share on other sites More sharing options...
Dethman Posted January 12, 2008 Author Share Posted January 12, 2008 I need to Minus 30 from the PPT Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437105 Share on other sites More sharing options...
Ken2k7 Posted January 12, 2008 Share Posted January 12, 2008 Uh..I think: function PPT($id){ $sql="UPDATE `user_users` SET `PPT`='PPT-30'"; } Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437112 Share on other sites More sharing options...
MasterACE14 Posted January 12, 2008 Share Posted January 12, 2008 Advice: use a more descriptive heading and explain what your problem is in your post, we're not mind readers Regards ACE Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437201 Share on other sites More sharing options...
twostars Posted January 12, 2008 Share Posted January 12, 2008 explain what your problem is in your post, we're not mind readers We need to code a PHP script to read minds! Who is with me!? Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437204 Share on other sites More sharing options...
dooper3 Posted January 12, 2008 Share Posted January 12, 2008 @twostars - It'd never work. I don't have a mind. But i'm willing to give it a try (n.b. such a script would never work on the female mind though!) Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437206 Share on other sites More sharing options...
Barand Posted January 12, 2008 Share Posted January 12, 2008 If you want to limit the change to just the single record with the id passed to the function then function PPT($id){ $sql="UPDATE `user_users` SET `PPT`= `PPT`- 30 WHERE id = '$id' "; } EDIT: and don't forget ypu will need a call to mysql_query() to execute the update. Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437208 Share on other sites More sharing options...
twostars Posted January 12, 2008 Share Posted January 12, 2008 @twostars - It'd never work. I don't have a mind. But i'm willing to give it a try (n.b. such a script would never work on the female mind though!) Hmm... that's true (second part), but males should be easy: <? $mind = new mind(); $action = new action(); $currentThought = $mind->thought(); while (!empty($currentThought)) switch ($currentThought) { case "hungry": $food = $action->retrieve("food"); $action->do("eat", $food); break; case "sex crave": $woman = $action->retrieve("woman"); $action->do("sex", $woman); break; case "bed": $bed = $action->find_closest("bed"); $action->do("walk", $bed); break; default: $action->do("shake", $mind->body_part("head")); } $currentThought = $mind->thought(); } ?> Sorry for being off-topic. Couldn't help it though. Link to comment https://forums.phpfreaks.com/topic/85649-is-this-right/#findComment-437211 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.