Jump to content

DB (help, please!)


Hugos

Recommended Posts

  • Moderators
1 hour ago, Hugos said:

How do I add data from a database? (I use the plugin mta_mysql)

 

Add data to a database?

INSERT INTO table_name (column1, column2 ) VALUES (?, ?)

 

OR

 

Get data from a database?

SELECT * FROM table_name

 

OR

 

Import data to a database from another database.

 

Edited by IIYAMA
  • Thanks 1
Link to comment
50 minutes ago, IIYAMA said:

 

Add data to a database?


INSERT INTO table_name (column1, column2 ) VALUES (?, ?)

 

OR

 

Get data from a database?


SELECT * FROM table_name

 

OR

 

Import data to a database from another database.

 

I get the player 's serial number at the moment, and if it 's not already recorded in the DB - I add.

local username = getPlayerName(source)
local serial = tostring(result_account.serial)
local u_serial = getPlayerSerial(source)

if (serial == u_serial) then --We check the serial number
else
	if (serial == "") then --number will stop. Assign a new
		INSERT INTO accounts (,  ) VALUES (?, ?)
	else
	end
end

How it is correct to make it?

Edited by Hugos
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...