^iiEcoo'x_)

* [ 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
)

 

Share this post


Link to post

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
)

 

Share this post


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

فلتفعل !

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

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

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

Share this post


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

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


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

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

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

Share this post


Link to post
34 minutes ago, #_iMr.[E]coo said:

تأكدت من الكوليمن , وتأكدت من القيمة

@iMr.WiFi..! أعطيك المود تشوف مشكلته ؟

اطرح الكود وماخلفه عشان نقدر نساعدك ..

Share this post


Link to post
2 minutes ago, #_iMr.[E]coo said:

ورا شغل سنين ذذ

عاد مدري كيف بساعدك , يمكن اساعدك تخاطرياً ؟

Share this post


Link to post
2 minutes ago, iMr.WiFi..! said:

عاد مدري كيف بساعدك , يمكن اساعدك تخاطرياً ؟

إيش أعطيك بالضبط ؟ , لانه وراه 300 سطر 

Share this post


Link to post

لا انا اقصد الكود نفسه يعني لو هو داخل حدث وريني الحدث بالكامل عشان اقدر احله : @

Share this post


Link to post
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
)

 

Share this post


Link to post

Attention = هو نفس الجدول الي انت تبيه ؟ , ولا لخبطت هو والجدول CreateSystem

Share this post


Link to post

قسم انه جنني 

executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS Attention ( aSerial_ TEXT , aName_ TEXT ,aInfos TEXT ) ')

 

Share this post


Link to post
executeSQLQuery("CREATE TABLE IF NOT EXISTS Attention ( aSerial_ INTEGER , aName_ TEXT ,aInfos TEXT )")

اعتقد هيك الصح

Share this post


Link to post

لم يزبطط

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

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

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 ,

Share this post


Link to post
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' )

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

Share this post


Link to post
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

 

Share this post


Link to post
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
)

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.