Share Pastebin
Guest
Public paste!

TiPhoon

By: a guest | Mar 21st, 2010 | Syntax: Lua | Size: 0.53 KB | Hits: 70 | Expires: Never
Copy text to clipboard
  1. function VehSQL(player, command, car)
  2.         handler = mysql_connect("localhost", "root", "000000", "myserver")
  3.         if not handler then
  4.                 outputChatBox("Something wrong here with the database.")
  5.         else
  6.                 outputChatBox("Connected.")
  7.                 local queryobj = "SELECT vehid FROM `vehicles` WHERE vehicle = "..car..""
  8.                 local result = mysql_query(handler, "SELECT vehid FROM `vehicles` WHERE vehicle = '" ..car .. "'")
  9.                 outputChatBox("The car id is " ..result.. ".", player)
  10.                 mysql_free_result(result)
  11.         end
  12. end
  13. addCommandHandler("vehSQL", VehSQL)