PDA

View Full Version : adding more tables mysql


MrCesar
10/01/2018, 12:32 AM
hey, i've started using mysql and i followed this tutorial:

http://forum.sa-mp.com/showthread.php?t=627520&highlight=register+system

and i don't really understand how i can add more tables like admin level, vip level, position, weapons all of it upon saving besides everything it has.

thanks in advance!

Hypex
10/01/2018, 12:38 AM
You basically have to do the same thing the creator did find "score" for example and do the same thing.Warning if you want to save the position you'll have to make it a float.
Although the easiest MySQL saving system I've used is http://forum.sa-mp.com/showthread.php?t=606930
everything is straight forward with this and well organized.

iLearner
10/01/2018, 05:42 AM
What you want to add is column I suppose? simply run this command in phpmyadmin (if you have):
ALTER TABLE <table_name> ADD column_name type null/notnull/AUTO_INCREMENT;

MrCesar
10/01/2018, 11:37 AM
oh so i can just add the tables at the database and pull them into the game by the script?with pinfo?

denNorske
10/01/2018, 12:41 PM
Well somewhat like that.

You go into the database, add the table you want (or columns you need for new fields)
Then, make the columns or table load into the script and assign the values you load into variables (for instance)
And use the information like that.

This is done the same way as in the system you linked:
https://image.prntscr.com/image/c0ZG5z1zSl6uKsREXWrZ1g.png

The same method to save the data too as in the tutorial, you need to update the data in the fields. (UPDATE table SET ...)

MrCesar
10/01/2018, 01:02 PM
Well somewhat like that.

You go into the database, add the table you want (or columns you need for new fields)
Then, make the columns or table load into the script and assign the values you load into variables (for instance)
And use the information like that.

This is done the same way as in the system you linked:
https://image.prntscr.com/image/c0ZG5z1zSl6uKsREXWrZ1g.png

The same method to save the data too as in the tutorial, you need to update the data in the fields. (UPDATE table SET ...)

thanks that helped me out alot :D