Raised This Month: $ Target: $400
 0% 

Multiple rows in SQL


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-24-2011 , 03:31   Multiple rows in SQL
Reply With Quote #1

Hey, why the hell I get multiple rows by the same IP in SQL ? Like I create them when player connects, but I check this:

PHP Code:
format(szTemp,charsmax(szTemp),"SELECT * FROM `players` WHERE (`players`.`player_ip` = '%s')"szIp); 
PHP Code:
if(SQL_NumResults(Query) > 1)
{
/// here I retrieve all information that I need from SQL
}
else
{
//INSERT INTO ...

My table looks like this:

Quote:
player_id INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY,\
player_ip varchar(32),\
player_name varchar(32),\
...

Where is the problem because every time I enter the server. The new row is created for me, even if there is already a row with that IP.
reinert is offline
 



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

Forum Jump


All times are GMT -4. The time now is 19:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode