AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   database help (https://forums.alliedmods.net/showthread.php?t=28020)

SSJ2GOKU 05-05-2006 11:27

database help
 
hello,

can anyone explain meh how to write to and read from a database file
also how do you use the stuff you get out of the database then?


thanks in advance

Rixorster 05-05-2006 12:28

Code:
// Creds: HRP for most of thingys :P #include <dbi> #include <engine> new Sql:dbc public plugin_init() {     register_plugin("Sql","1.0","Rixorster")     register_cvar("mysql_host","localhost",FCVAR_PROTECTED)     register_cvar("mysql_db","database",FCVAR_PROTECTED)     register_cvar("mysql_user","root",FCVAR_PROTECTED)     register_cvar("mysql_pass","",FCVAR_PROTECTED) public sql_init() {     new host[64]     new username[33]     new password[32]     new dbname[32]     new error[32]     get_cvar_string("mysql_host",host,64)     get_cvar_string("mysql_user",username,32)     get_cvar_string("mysql_pass",password,32)     get_cvar_string("mysql_db",dbname,32)     database = dbi_connect(host,username,password,dbname,error,32)     if (dbc == SQL_FAILED)     {         server_print("You fail at life^n")     }     else     {     server_print("Gg!^n")     } }

mysticssjgoku4 07-14-2006 00:25

Re: database help
 
Quote:

--- ESF AMXX CODER ---
Inappropriate use of a title. I pitty you.


All times are GMT -4. The time now is 05:14.

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