--------------------------------------------- CircleMUD + MySQL Tutorial (Rev 1.00): README --------------------------------------------- Release Date: 31 May 2003 (Rev 1.00) Introduction ------------ This provides you with the info you need to plug MySQL into your particular CircleMUD to be able to talk with a MySQL database. Usage ----- 1. Drop the mysql.c file into your source directory. The .c file is heavily commented. 2. Add an appropriate ACMD() if you're using this as a player command. 3. Add mysql.c to the appropriate sections in Makefile, or Makefile.in 4. Add "-lmysqlclient" to the LIBS section of Makefile and Makefile.in 5. Replace the following bits in mysql.c for your information: YOUR.HOST - Where your DB server is. IP or FQDN. YOUR.DB.USER - Your DB username YOUR.DB.PASS - Your DB password YOUR.DB - Your DB name YOUR.QUERY - Your DB query (i.e. SELECT * from myTable) Results ------- I've put this in as a MUD command, 'mysql'. Swap ACMD(do_mysql) for a standalone function if you wish - it's really up to you. Based on your query, it will log the result of your query to the SYSLOG. Adjust: log("%s", row[0]); log("%s", row[1]); log("%s", row[2]); to suit what you are trying to retrieve. In this file, I used a single table with two fields. row[0] was an 'id', row[1] was a 'body', whilst row[2] returns the dbname. Help! ----- I'll try and help you out if you drop me an email. Remember, the CircleMUD Mailing List is your best source of help. Credits ------- Just research I guess. I recommend buying the MySQL Manual that the MySQL publishes - it's available through Amazon.com, and is a print version of the 2nd URL below. More info: 1: http://www.woffordcollege.org/ecs/DataAndVisualization/CGIProgramsAndDatabases/material.htm 2: http://www.mysql.com/doc/en/index.html Have fun with it! -Caniffe (circlemud@caniffe.net) http://www.caniffe.org