Castillo

Untitled

Jul 22nd, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. function quer ( player )
  2.     outputChatBox ( "Query Run...", player, 255, 0, 0 )
  3.     if ( not database ) then
  4.         return outputChatBox ( "Invalid mysql handler" )
  5.     end
  6.  
  7.     local result = mysql_query ( database, "SELECT * FROM skins" )
  8.     outputChatBox ( "Result: ".. tostring ( result ) )
  9.     if ( result ) then
  10.         local row = mysql_fetch_assoc ( result )
  11.         outputChatBox ( "Row: ".. tostring ( row ) )
  12.         if ( row ) then
  13.             outputChatBox ( row [ "id" ] ..": ".. row [ "username" ] )
  14.             outputChatBox ( row [ "alltextures" ] ..": ".. row [ "allmodels" ] )
  15.         else
  16.             outputChatBox ( "No row" )
  17.         end
  18.         mysql_free_result ( result )
  19.     else
  20.         outputChatBox ( "No result" )
  21.     end
  22. end
  23. addCommandHandler("query", quer)
Advertisement
Add Comment
Please, Sign In to add comment