General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 6th, 2002, 12:25 AM
Attila Attila is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 67 Attila User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Confused

Sorry to bother with this but it is eluding me.

I am trying to fight my way through how to use sessions and to detect who is online. I have my own weired way that Ibeleive should work but I for somereason can not update to a tabel.

I get no errors. here is the coding.

PHP Code:
<?

include ($conf['rootdir']."includes/functions/dbconnect.php");
dbconnect ();
$name mysql_query("SELECT name FROM member WHERE name = '$name' AND password = PASSWORD('$password')");
$num_rows mysql_num_rows($name);

if (
$num_rows <= 0)
    {
        echo 
"<p align= center>You either entered your user name or password wrong.</p>";
        exit;
    }
if(
mysql_num_rows($name) != 0
    {
        
$verified_user $memberid;
        
$wired = (time()) + 10;  //I want to add 10 minutes
        
session_register($wired);
        echo 
$wired;
        
$showonline = ("UPDATE member SET online ='$wired' WHERE memberid = '$memberid'") or die ("Not updating.");
        
$result mysql_query($showonline) or die ("Query failed");
        echo (
"inside if");
    }
echo 
"<p align= center>You are now loged in</p>";

?>


Here is the database. I am wondering if I need to say more.
PHP Code:
 CREATE TABLE member (
memberid int(11NOT NULL auto_increment,
name text NOT NULL,
password text NOT NULL,
gamename text NOT NULL,
df1 tinytext NOT NULL,
df2 tinytext NOT NULL,
dflw tinytext NOT NULL,
tfd tinytext NOT NULL,
bhd tinytext NOT NULL,
gametag text NOT NULL,
perweapon text NOT NULL,
picturedata text NOT NULL,
picturename text NOT NULL,
picturetype text NOT NULL,
quote text NOT NULL,
status text NOT NULL,
position text NOT NULL,
email text NOT NULL,
msn text NOT NULL,
icq text NOT NULL,
aol text NOT NULL,
yahoo text NOT NULL,
website text NOT NULL,
number int(11NOT NULL default '0',
allow int(11NOT NULL default '1',
online TEXT NOT NULL;
PRIMARY KEY (memberid),
KEY memberid (memberid)
); 


I thought that maybe it was my connection to the database but my connection is working on all the other pages I use this code in the same loacation. I thought it would tell me not updating but it isn't.

Please help.

Thanks,
Attila
__________________
Thanks,
Attila
http://www.glorynaspiration.com
http://www.abitofthings.com

Reply With Quote
  #2  
Old December 6th, 2002, 04:36 PM
Attila Attila is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 67 Attila User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
LMAO....After struggling last night and part of today!!

Think of this COLLISIONS!!!

LOL word to the wise do not name your query the same name as an item you are trying to retrive from the query!!! LMAO

And yes I am so!! But I can move on!

Reply With Quote
  #3  
Old December 6th, 2002, 07:05 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 6
Also, this is wrong ->

PHP Code:
 $wired = (time()) + 10;  //I want to add 10 minutes 


If you want to add 10 minutes, the value would be 600...
__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Confused


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT