changing vaules in tables

This is a discussion on "changing vaules in tables" within the Databases section. This forum, and the thread "changing vaules in tables are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 16th, 2008, 19:17
Junior Member
Join Date: Feb 2008
Location: U.S.A
Age: 26
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
changing vaules in tables

hey guys, i need to be able to change a specific value in a table: there are three values in a row in this table, NAME, PASSWORD, and BOOLY. i want to be able to toggle BOOLY for when the person is logged on or not, so change that value to 0 when they are not logged on, and 1 when they are. i have all the rest of the code done, just this part is stumping me. i tried fetching the array of this row and saying "$result['BOOLY'] = "1" " and so forth, but that didnt change it in the database for some reason. thnaks guys
Reply With Quote

  #2 (permalink)  
Old Mar 18th, 2008, 00:32
Junior Member
Join Date: Feb 2008
Location: U.S.A
Age: 26
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: changing vaules in tables

does nobody know or is this impossible and no one wants to tell me? thx
Reply With Quote
  #3 (permalink)  
Old Mar 18th, 2008, 11:53
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: changing vaules in tables

Yeah this is definitely possible

Monie's Tips:
Assuming you have a Login-Verify-Success method of doing your login page... So, in your verify page, you should have some kind of redirect the user to the main page , right? Ok, right before the redirect code, you need to execute some sql statement that will UPDATE your 'BOOLY' field and set it to 1.

When you logging out, you will also need to execute some sql statement that will UPDATE your 'BOOLY' field and set it to 0.

MySQL Sample Statement:
PHP: Select all

// Your database connection here...
// TITLE: Update User Status/Info Upon Login Session
$sql "UPDATE TableName SET BOOLY = 1 WHERE username = '$name'";
$result mysql_query($sql$connection) or die(mysql_error()); 
Let me know if you stuck!
Could you post in your verify.php page as well as your logout.php page?
Cheers...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Mar 18th, 2008 at 11:59.
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing these Tables Aerdan Web Page Design 8 Nov 24th, 2007 18:44
Changing CSS with PHP Emzi PHP Forum 7 Oct 11th, 2007 23:24
changing pic's bruno89 Web Page Design 4 Sep 8th, 2006 15:22
changing %20 in URL using PHP JamieH PHP Forum 1 Dec 8th, 2005 13:52
why are my fonts changing? Val J Flash & Multimedia Forum 0 Sep 1st, 2005 20:29


All times are GMT. The time now is 07:32.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43