Current location: Hot Scripts Forums » Programming Languages » PHP » 1 row + 1


1 row + 1

Reply
  #1 (permalink)  
Old 10-23-04, 10:39 AM
steveo steveo is offline
Wannabe Coder
 
Join Date: Jun 2004
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
1 row + 1

Hi, I'm trying to create a ltitle php code to add 20 to every single member in my row.

Current it goes like this..

Name,points,email,key

because halloween is coming up, I want to give every member say 20 extra points on their original points already.

So one member could have 49 points and another has 794 points. How could I do this?

Firstly I've tried doing a while loop, but that didnt work. So I'm kinda stuck.
Can anyone help?
Reply With Quote
  #2 (permalink)  
Old 10-23-04, 12:09 PM
Four0Four Four0Four is offline
Newbie Coder
 
Join Date: Sep 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

mysql_query("UPDATE usertable SET points = points+20 WHERE points > 0"); 

I have did this a few times as well, hope it works!

-4oh4
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Row in Databse? steveo PHP 2 09-11-04 04:40 AM
strings in a mysql row Aesis PHP 8 08-18-04 02:33 AM
Delete row from mysql error. bigkid PHP 1 08-05-04 09:36 PM
place new data in old row via php? [php/mysql] dthom PHP 1 05-09-04 08:38 AM
Update more than one row davids PHP 10 05-07-04 04:57 PM


All times are GMT -5. The time now is 04:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.