egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mysql table read

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
asmds
Voice


Joined: 30 Jul 2005
Posts: 1

PostPosted: Sat Jul 30, 2005 5:26 pm    Post subject: mysql table read Reply with quote

Hi all

Im trying to understand mysql and tcl because i want to do a script that uses a database, but i need some help.

first : i want that my eggdrop reads from a database when a user join my channel to see if that user is registered in a website that i run, if the user is not registered the bot will ban him and ask the user to do the registration.

I know how to do the basic TCL for this script, i just cant do the mysql part.

can you give me an example of the code to see +/- how to do it ? what do i need to run mysql ? mysqltcl only ?

the table is small, the fields are

Code:
  `id` mediumint(8) NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `mgroup` smallint(3) NOT NULL default '0',
  `password` varchar(32) NOT NULL default '',



Thanks
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Jul 30, 2005 6:35 pm    Post subject: Reply with quote

did you go here already? if not, do so
Back to top
View user's profile Send private message Visit poster's website
Galadhrim
Op


Joined: 11 Apr 2003
Posts: 123
Location: Netherlands, Enschede

PostPosted: Sun Jul 31, 2005 5:23 am    Post subject: Reply with quote

Quote:
what do i need to run mysql ? mysqltcl only ?

You need a mysql server, like the one from your site. (The data doesn't come from a blackhole Very Happy ) And you need mysqltcl. You can talk to the server using the mysqltcl in your tcl script.

Once you got that create a query that gets the user data from the database like
Code:
SELECT * FROM users WHERE username='$nick'


Then you can read the data and decide if the person can stay or not.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 02, 2005 5:51 am    Post subject: Reply with quote

besides the popular among this community mysql.mod module and mysqltcl APIs, there's third option for using SQL database with eggdrop: SQLite, small & fast database engine with Tcl interface
Back to top
View user's profile Send private message Visit poster's website
Galadhrim
Op


Joined: 11 Apr 2003
Posts: 123
Location: Netherlands, Enschede

PostPosted: Tue Aug 02, 2005 7:47 am    Post subject: Reply with quote

indeed, with that you dont need a separate mysql database server, since the package is the server.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber