Small problem

hi if i have those scripts and i want to make them on mysql can some1 give me an idea?


and this thoo

INI_WriteString(File,"Vehicle1Plate",PlayerInfo[playerid][pVehicle1Plate]);pls i don't know how to make them work with mysql

If you don't know how to make simple things like that in MySQL, you are better off either learning atleast basic functions of it or not using it at all.

Account system with MySQL tutorial by Overhaul covers alot of ground on mysql, you can find out how to use most of the functions you need from his guide found HERE(click).

You need to make colums in mysql with same name like

Vehicle1 / Vehiclex etc .

then like this is Example

 	new query[128];
	mysql_format(mysql, query, sizeof(query),"UPDATE `players` SET `Vehicle1`=%d,`Vehicle1X`=%f WHERE `ID`=%d",  PlayerInfo[playerid][pVehicle1],PlayerInfo[playerid][pVehicle1X],pInfo[playerid][PDID]);
	mysql_tquery(mysql, query );
this was just example you can save other like this.

One rule that you should keep in mind is: columns should never* have a number in their name. If they have then the database model is wrong. And contrary to what MBilal says above you need to make rows, not columns. If one vehicle is owned by one player, and one player only then the table, separate from that of the player one, should look somewhat like:

id ownedBy model x y z
1 5 411 1247.12 -147.31 12.02
7 NULL 500 2487.97 1578.56 13.57
8 1 562 -2478.86 -2047.12 25.36
where ownedBy is linked to a specific player. So if you have a player entry somewhat like this:

id name rank
1 Bob 5
Then you know that vehicle 8 is owned by Bob, because Bob has id 1.

*There are certain exceptions, but they are few. Doing something like color1 and color2 for car colors is fine, but I can't think of anything else right now.

Forum Jump:

Users browsing this thread: 1 Guest(s)