Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 7th, 2004, 09:01 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Mysql table and strange problem

Hi
I am using phpMYAdmin to create the Mysql tables but i am facing strange proble(atleast for me it is strange) with one table called User,I have two fields in this table 'user' and 'password'. problem is this that i can add data using php form but when user try to login through php form, it is reading just first row,if i try to log in as other users with their password, i get the message that it is wrong password but if i try to login as other users with the first user's password i can login as first user and i cannot understand why is this happening can any one help me out please because i dont have a clue what is going on here
SQL query for the User table is
[code]
# Table structure for table `USER`
#

CREATE TABLE USER (
User varchar(20) NOT NULL default '',
password varchar(200) NOT NULL default '',
PRIMARY KEY (User)
) TYPE=MyISAM;
[/ode]

Reply With Quote
  #2  
Old April 7th, 2004, 09:26 PM
Nicky's Avatar
Nicky Nicky is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Neverland
Posts: 606 Nicky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 26 sec
Reputation Power: 2
RE: Mysql table and strange problem

Could you post the code you are using to get the login details off the user and the code you are using to check those details against the database.

Thanks

Reply With Quote
  #3  
Old April 7th, 2004, 09:55 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: RE: Mysql table and strange problem

hi

thank u for ur help, infact when i was copingy code for u i just realised that i have used
php Code:
Original - php Code
  1.  
  2. if($row=mysql_fetch_array($result)) 


instead of

php Code:
Original - php Code
  1.  
  2. while($row=mysql_fetch_array($result)) 

problem is solved now
can u help me to decide something else as well
i want to set limited number of trying if someone has entered wrong password. can u give me idea how i can do it please

Reply With Quote
  #4  
Old April 7th, 2004, 10:01 PM
Nicky's Avatar
Nicky Nicky is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Neverland
Posts: 606 Nicky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 26 sec
Reputation Power: 2
RE: Mysql table and strange problem

I'd set a session variable - say login_count - if they fail the login increment the login_count... if they suceed reset it.

Before you display the login form .. or whatever you have ... check the value and if it equals or is greater than your limit then give them a message they have to wait otherwise present the login form to them.

Reply With Quote
  #5  
Old April 7th, 2004, 10:06 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: RE: Mysql table and strange problem

thank u i ll try that on weekend an email problems on the forum.

Reply With Quote
  #6  
Old April 7th, 2004, 10:09 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Mysql table and strange problem


Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Mysql table and strange problem


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 4 hosted by Hostway