Hello there,


introduction
So I decided to make my first guide. Please don't throw with negative comments since i'm new here and its also my first tutorial. If i'm wrong with something just reply here below so I can edit it. Anyway, lets go!

1 fact for the people who don't know it: Did you know that your UCP isn't connected to the server, but to the mysql database?



Script Part
So if you want your scripts gets his information from a mysql database, you will have to put it in to your script and i'm gonna tell you what and where you have to put it. First of all you need to use a include. The include you have to use is: a_mysql.inc which have to be in your "include" folder. You will find it in your pawno folder. If you don't have, here is a link where you can download it: http://www.solidfiles.com/d/394/a_mysql.inc
After you have made sure you have it in your 'include' folder, you will have to write in your script. You will write at the top of the script like this :
Code:
#include <a_mysql>
. After you have done that, you will define stuff. You will define 4 things. You will define your Mysql host, your user(name), your pass(word) and your data base. It will look something like this:
Code:
#define SQL_HOST "localhost" << If its not local host type the host adress there.
#define SQL_USER "YOUR USERNAME"
#define SQL_PASS "YOUR PASSWORD" <<< If you have got a password.
#define SQL_DB "YOUR DATABASE NAME"
The last thing you have to do in the script part is add this
Code:
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
mysql_debug(1);
Under this "public OnGameModeInit()"

Now we are done with the script part, so lets move to the Mysql part!

Mysql part

This part is pretty simple. In this part you just have to load your files in the mysql database. If you have done that, you will have a server where your mysql database and the samp server are connected with each other.
So now we are done here and move to the ucp part.


UCP Part.

So now we are at the UCP Part and also the last part.
For the people who downloaded a ucp, they won't recogonize this part in your ucp script:
Code:
$con = mysql_connect("CHANGE ME [THIS IS THE DATABASE HOST. IF ITS LOCAL JUST TYPE "Localhost"] ","CHANGE ME[USER NAME DATABASE]","CHANGE ME [PASSWORD DATABASE ( If you have 1]");
if(!$con)
{
die ("error connecting to mysql");
}
$db = mysql_select_db("CHANGE ME [DATABASE NAME]");
if(!$db)
{
die ("error selecting mysql database");
So for the people who downloaded a ucp, open up every file that includes for your ucp and search for that part in every file. Change the things you have to change and I already said what you have to change. For the people who have made their own ucp ( I'm pretty sure y'all did put it into your script), but didn't put it in their ucp, put it into your script and all the information about your mysql ( Username,password,database name, etc.. )


If you have done that, you are completely done! Please +rep me for this tutorial and if there is something wrong here just reply here below and I will change it. Please don't be hard, its my first guide!