[REQ][2000 credits][PHP]From file to database

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
I got a script that reads user info from files... I want it to read from sql instead.

This is the database-structure I am usinf:

Code:
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL auto_increment,
  `auth_username` varchar(30) NOT NULL,
  `auth_password` varchar(30) NOT NULL,
  `auth_mode` varchar(30) NOT NULL,
  `auth_confirmation` varchar(30) default NULL,
  `nickname` varchar(255) default NULL,
  `email` varchar(255) default NULL,
  `fullname` varchar(255) default NULL,
  `dob` varchar(255) default NULL,
  `gender` varchar(255) default NULL,
  `postcode` int(30) default NULL,
  `country` varchar(255) default NULL,
  `language` varchar(255) default NULL,
  `timezone` varchar(255) default NULL,
  `public` varchar(255) default NULL,
  PRIMARY KEY  (`id`)
)


This is the file that needs to be rewritten to use ^those^ instead of a file:
http://pastebin.com/f2b351861

Could anyone please do this? It's basically change everything in the script to read the userinfo from that table
 
Last edited:

NaHoW

New Member
Messages
244
Reaction score
0
Points
0
Re: [REQ][1700 credits]
PHP:
From file to database[/b]

Can I do that? I will manually insert them if you give me access to your PHPMyAdmin
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Can I do that? I will manually insert them if you give me access to your PHPMyAdmin

What do you mean? I have already made the database part and the registration part. I need the rest of the script to use mySQL to read the user data instead of the file.

Because if you do ?user=vigge_sWe, it will look after vigge_sWe.auth file where the settings are saved. I want it to check in the table "users" under the correct user

*closed, tnl2k7 said he will try*
 
Last edited:

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Re: [REQ][1700 credits]
PHP:
From file to database[/b]

Ok I need this again, but I will offer 2000 credits now.
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
ok, hold on. i'll try this now. i need the 2000 points :D

couple of questions, what's the t() and set_t()? what do those functions do and look like?
 
Last edited:

balaji2u

New Member
Messages
410
Reaction score
2
Points
0
i think i can do this.send me all the script files that depend on the file to read the data and also the sample of data may be a database containing two or three records or just give me authentication to ur panel.im comfortable with any of these methods.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
a:4:{s:13:"auth_username";s:5:"admin";s:13:"auth_password";s:32:"9cdfb439c7876e703e307864c9167a15";s:9:"auth_mode";s:4:"form";s:12:"auth_confirm";b:1;}
a:0:{}
a:9:{s:8:"nickname";s:9:"vigge_sWe";s:5:"email";s:19:"test@gmail.com";s:8:"fullname";s:11:"test test";s:3:"dob";s:10:"1992-11-24";s:6:"gender";s:1:"M";s:8:"postcode";s:5:"44330";s:7:"country";s:2:"SE";s:8:"language";s:2:"sv";s:8:"timezone";s:16:"Europe/Stockholm";}

If you mean the database, just create an new user at the register.php file
 
Last edited:

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
where it has s:#, are those numbers the same for everyone's or do they differ? i'm asking because i've never used openid, but can still do this
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
man, i hate regex. i cannot find out how it works right :'(. i have the following, but i want to strip everything uptil the last ":". so for s:13:"auth_username", i want it to just show auth_username
PHP:
preg_match("/s:\d:\"(.*+)\"/", $v2, $match);
$v2 = one line in the code below
Code:
a:4:{s:13:"auth_username"
s:5:"admin"
s:13:"auth_p assword"
s:32:"9cdfb439c7876e703e307864c9167a15"
s :9:"auth_mode"
s:4:"form"
s:12:"auth_confirm"
b:1
}
a:0:{}
a:9:{s:8:"nickname"
s:9:"vigge_sWe"
s:5:"email"
s: 19:"test@gmail.com"
s:8:"fullname"
s:11:"test test"
s:3:"dob"
s:10:"1992-11-24"
s:6:"gender"
s:1:"M"
s:8:"postcode"
s:5:"44330 "
s:7:"country"
s:2:"SE"
s:8:"language"
s:2:"sv"
s :8:"timezone"
s:16:"Europe/Stockholm"
}
 
Last edited:

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
man, i hate regex. i cannot find out how it works right :'(. i have the following, but i want to strip everything uptil the last ":". so for s:13:"auth_username", i want it to just show auth_username
PHP:
preg_match("/s:\d:\"(.*+)\"/", $v2, $match);
$v2 = one line in the code below
Code:
a:4:{s:13:"auth_username"
s:5:"admin"
s:13:"auth_p assword"
s:32:"9cdfb439c7876e703e307864c9167a15"
s :9:"auth_mode"
s:4:"form"
s:12:"auth_confirm"
b:1
}
a:0:{}
a:9:{s:8:"nickname"
s:9:"vigge_sWe"
s:5:"email"
s: 19:"test@gmail.com"
s:8:"fullname"
s:11:"test test"
s:3:"dob"
s:10:"1992-11-24"
s:6:"gender"
s:1:"M"
s:8:"postcode"
s:5:"44330 "
s:7:"country"
s:2:"SE"
s:8:"language"
s:2:"sv"
s :8:"timezone"
s:16:"Europe/Stockholm"
}

But what do you want to do with the files? Because I want the script to check username and info from the database instead from those files...
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
well, don't you have to put the info from the file into the database atleast once while registering?
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
hmm, how do they get the user information?

man, clamshell is kinda confusing...

edit:
looking deeper, it looks like simple_reg_builder is responsible for getting the data i think...
 
Last edited:

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
hmm, how do they get the user information?

man, clamshell is kinda confusing...

edit:
looking deeper, it looks like simple_reg_builder is responsible for getting the data i think...

well, all userinfo are stored in the database now when the user register. The script should basically, look for it in the db without needing those files
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
ah, so you've already got it to put all that info in? why didn't you tell me that earlier :p
 
Top