Sign in to follow this  
Mr.Mostafa

مشكلة بقاعدة بيانات

Recommended Posts

سلام عليكم

وش الخطا بهذا الكود عشان جربت اكتر من محاولة وطفشت

executeSQLQuery('CREATE TABLE IF NOT EXISTS moneySystem2 (theMoney,playerSerial)')

setTimer(function()
	local Playerss = getElementsByType ( 'player' )
		for _ , v in ipairs ( Playerss ) do
			local Check = executeSQLQuery('SELECT * FROM moneySystem2 WHERE playerSerial = ?',getPlayerSerial(v))
			if (#Check == 0 or not Check) then
				executeSQLQuery('INSERT INTO moneySystem2 (theMoney,playerSerial)',getPlayerMoney(v),getPlayerSerial(v))
					outputChatBox('Saved',root,0,255,0,true)
					else
				executeSQLQuery('UPDATE moneySystem2 SET theMoney = ? WHERE playerSerial = ?',getPlayerMoney(v),getPlayerSerial(v))
			outputChatBox('UPDATE',root,255,0,0,true)
			end
		end
end,50,0)

 

Share this post


Link to post
executeSQLQuery('INSERT INTO moneySystem2 (theMoney,playerSerial) VALUES(?, ?)',getPlayerMoney(v),getPlayerSerial(v))

 

مع العلم الي قاعد تسويه غلط كبير جداً ، تحدث الداتا بيس كل 50 ملي  ثانية !!! وفوقها داخلها لوب !! كارثة من اللاق

Share this post


Link to post
Posted (edited)
5 minutes ago, HassoN said:

مع العلم الي قاعد تسويه غلط كبير جداً ، تحدث الداتا بيس كل 50 ملي  ثانية !!! وفوقها داخلها لوب !! كارثة من اللاق

بعدلها الحين 

5 minutes ago, HassoN said:

VALUES(?, ?)

يب صح مدري كيف نسيتها 

Edited by Mr.Mostafa

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.