Jump to content

* [ SQL مشكلة ]


Recommended Posts

السلام عليكم ورحمة الله وبركاته 

عندي مشكلة , صار لي ساعة عليها _

المهم المشكلة إنه مستدعي بيانات الاعب بس ما يجيبهن بقريد ليست

aServer Side 

local aSelect = executeSQLQuery ( 'SELECT * FROM CreateSystem WHERE aSerial_ =? ' , aSerial_ )
triggerClientEvent ( source , 'Attention' , source , aSelect )

aClientSide

addEvent ( 'Attention' , true )
addEventHandler ( 'Attention' , root ,
	function ( aSelect )
		guiGridListClear ( GUIEditor2.gridlist[2] )
		for i , v in ipairs ( aSelect ) do 
			local aRow_ = guiGridListAddRow( GUIEditor2.gridlist[2] )
			guiGridListSetItemText ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] , false , false )
			guiGridListSetItemData ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] )			
			guiGridListSetItemText ( GUIEditor2.gridlist[2] , aRow_ , 2 , aSelect[i]['aInfos_'] , false , false )
			guiGridListSetItemData ( GUIEditor2.gridlist[2] , aRow_ , 2 , aSelect[i]['aInfos_'] )
			guiGridListSetItemData ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aSerial_'] )									
		end
	end
)

 

Link to comment

aClientSide_

addEvent ( 'Attention' , true )
addEventHandler ( 'Attention' , root ,
	function ( aSelect )
		guiGridListClear ( GUIEditor2.gridlist[2] )
		for i , v in ipairs ( aSelect ) do 
			local aRow_ = guiGridListAddRow( GUIEditor2.gridlist[2] )
			guiGridListSetItemText ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] , false , false )
			guiGridListSetItemData ( GUIEditor2.gridlist[2] , aRow_ , 1 , {aSelect[i]['aName_'],aSelect[i]['aSerial_']} )			
			guiGridListSetItemText ( GUIEditor2.gridlist[2] , aRow_ , 2 , aSelect[i]['aInfos_'] , false , false )
			guiGridListSetItemData ( GUIEditor2.gridlist[2] , aRow_ , 2 , aSelect[i]['aInfos_'] )
		end
	end
)

 

Link to comment
9 minutes ago, iMr.WiFi..! said:

فلتفعل !

اسمع ضهرلي خطأ مدري كيف

executeSQLQuery ( 'INSERT INTO Attention ( aSerial_ , aName_ , aInfos_ ) VALUES ( ? , ? , ? ) ', aSerial_ , aName_ , aInfos_ )

يقول هذا aInfos_ غير موجود

Link to comment
Just now, #_iMr.[E]coo said:

اسمع ضهرلي خطأ مدري كيف


executeSQLQuery ( 'INSERT INTO Attention ( aSerial_ , aName_ , aInfos_ ) VALUES ( ? , ? , ? ) ', aSerial_ , aName_ , aInfos_ )

يقول هذا aInfos_ غير موجود

تأكد من كولمن انفوس او قيمة انفوس نفسها 

Link to comment
addEvent ( 'CreateAtt' , true )
addEventHandler ( 'CreateAtt' , root ,
	function ( aPlr_ , aName_ , aInfos_ )
		local aPlr_ = getPlayerFromName ( aPlr_ )
		local aSerial_ = getPlayerSerial ( aPlr_ )
		local result = executeSQLQuery ( 'SELECT aSerial_ , aName_ , aInfos FROM CreateSystem WHERE aSerial_ =? ' , aSerial_ )
			executeSQLQuery ( 'INSERT INTO Attention ( aSerial_ , aName_ , aInfos ) VALUES ( ? , ? , ? ) ', aSerial_ , aName_ , aInfos_ )
		end 
	end
)

 

Link to comment

لم يزبطط

ي عيال ظهرلي خطأ شوفوا

كود وضع الداتا عالرو

guiGridListSetItemDataWithKey ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] , 'name' )			
guiGridListSetItemDataWithKey ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aSerial_'] , 'serial' )	

كود جلب الداتا من الرو

local aName_ = guiGridListGetItemDataWithKey ( GUIEditor2.gridlist[2] , selectedRow , 1 , 'name' )
local aSerial_ = guiGridListGetItemDataWithKey ( GUIEditor2.gridlist[2] , selectedRow , 1 , 'serial' )

بس أطلع نص بالشتت ب الإسم والسريال يطلعلي nil

@!#NssoR_) , @Abdul KariM ,

Link to comment
addEvent ( 'Attention' , true )
addEventHandler ( 'Attention' , root ,
	function ( aSelect )
		guiGridListClear ( GUIEditor2.gridlist[2] )
		for i , v in ipairs ( aSelect ) do 
			local aRow_ = guiGridListAddRow( GUIEditor2.gridlist[2] )
			guiGridListSetItemText ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] , false , false )
			guiGridListSetItemDataWithKey ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] , 'name' )			
			guiGridListSetItemDataWithKey ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aSerial_'] , 'serial' )						
		end
	end
)
if ( guiGridListGetSelectedItem ( GUIEditor2.gridlist[2] ) ~= -1 ) then
local selectedRow, selectedColumn = guiGridListGetSelectedItem ( GUIEditor2.gridlist[2] )
local aName_ = guiGridListGetItemDataWithKey ( GUIEditor2.gridlist[2] , selectedRow , 1 , 'name' )
local aSerial_ = guiGridListGetItemDataWithKey ( GUIEditor2.gridlist[2] , selectedRow , 1 , 'serial' )

السورس كود حاطه  &

Link to comment
addEvent ( 'Attention' , true )
addEventHandler ( 'Attention' , root ,
	function ( aSelect )
		guiGridListClear ( GUIEditor2.gridlist[2] )
		for i , v in ipairs ( aSelect ) do 
			local aRow_ = guiGridListAddRow( GUIEditor2.gridlist[2] )
			guiGridListSetItemText ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] , false , false )
			guiGridListSetItemData ( GUIEditor2.gridlist[2] , aRow_ , 1 , { sName = aSelect[i]['aName_'] , sSerial = aSelect[i]['aSerial_'] } )
		end
	end
	)
	
	
if ( guiGridListGetSelectedItem ( GUIEditor2.gridlist[2] ) ~= -1 ) then
local selectedRow, selectedColumn = guiGridListGetSelectedItem ( GUIEditor2.gridlist[2] )
local aName_ = guiGridListGetItemData ( GUIEditor2.gridlist[2] , selectedRow , 1 ).sName
local aSerial_ = guiGridListGetItemData ( GUIEditor2.gridlist[2] , selectedRow , 1 ).sSerial

 

Link to comment
15 minutes ago, Abdul KariM said:

addEvent ( 'Attention' , true )
addEventHandler ( 'Attention' , root ,
	function ( aSelect )
		guiGridListClear ( GUIEditor2.gridlist[2] )
		for i , v in ipairs ( aSelect ) do 
			local aRow_ = guiGridListAddRow( GUIEditor2.gridlist[2] )
			guiGridListSetItemText ( GUIEditor2.gridlist[2] , aRow_ , 1 , aSelect[i]['aName_'] , false , false )
			guiGridListSetItemData ( GUIEditor2.gridlist[2] , aRow_ , 1 , { sName = aSelect[i]['aName_'] , sSerial = aSelect[i]['aSerial_'] } )
		end
	end
	)
	
	
if ( guiGridListGetSelectedItem ( GUIEditor2.gridlist[2] ) ~= -1 ) then
local selectedRow, selectedColumn = guiGridListGetSelectedItem ( GUIEditor2.gridlist[2] )
local aName_ = guiGridListGetItemData ( GUIEditor2.gridlist[2] , selectedRow , 1 ).sName
local aSerial_ = guiGridListGetItemData ( GUIEditor2.gridlist[2] , selectedRow , 1 ).sSerial

 

شكرا وملييون ترليون شكرا

مسوي بالسكل , لما احدد من قريد ليست يحذف الي اخترته , بس هو يحذف كل بيانات الاعب , 

بالترايفقر

مسوي اعطي تنبيه للاعب , بس لما اختار من قريد ليست التنبيه واأحذفه يحذف كل البيانات , ابيه يحذف هذا التنبيه فقط

triggerServerEvent ( 'ssss' , localPlayer , aName_ , aSerial_ )

وبالسيرفر

addEvent ( 'DeleteAttention' , true )
addEventHandler ( 'DeleteAttention' , root ,
	function ( aName_ , aSerial_ )		
		executeSQLQuery ( 'DELETE FROM Attention WHERE aSerial_ =?' , aSerial_ , aName_ )
		local result = executeSQLQuery ( 'SELECT * FROM Attention WHERE aSerial_ =? ' , aSerial_ )
		triggerClientEvent ( source , 'Attention' , source , result )		
	end
)

 

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...