Jump to content

Tables


bradio10

Recommended Posts

Not sure whether I should post this here or in the tutorials section, but can someone make a tutorial on tables?

I've been trying to work with table for storing stuff in (i am wanting to make an inventory system) and I just find tables to be really confusing. But like, a tutorial where you get data from like an SQL server or something and you put that data into the table, then like get data from the table as well. Mostly just getting specific data from tables is what I am confused about, like if I want to get a particular item from a table and change its amount value, then save that change back into the table, thats what I am confused on.

So ye, if someone could make a table tutorial or explain all that even in this topic, I'd be very thankful!

Thanks.

Link to comment

I know how to use most of the db functions (insert, create, update, delete, etc), but I don't know how to put all the data into a table, then use the table to change data instead of always having to change it through SQL (which im guessing is more resource intensive than using tables right?)

Link to comment

Ok, thanks for that.

Now, can anybody provide an example or something of how I could manipulate data in a table that has had data added to it by an SQL query?

Even if anybody knows of any free resources that use a method like this that is easy to understand, I am willing to take a look at that.

thanks.

Link to comment
  • MTA Team

oIBrNAg.png

These are functions and not "strings/operations". Where did you learn that nonsense?

Anyway, after connecting to a MySQL database you can use the function mysql_query function to manipulate the database with the SQL language.

http://www.w3schools.com/sql/default.asp

Examples:

SELECT * FROM `table_name` WHERE `serial`='...' LIMIT 1; 

UPDATE `table_name` SET `money`=5000, `level`=5, `nick`='Test' WHERE `serial`='...'; 

INSERT INTO `table_name` (`serial`, `money`, `level`) VALUES ('...', 5000, 3); 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...