Jump to content

MySQL Short Help!


FlyingSpoon

Recommended Posts

 function pump_rem ( p, cmd ) 
   if ( exports.global:isPlayerAdvancedSupervisor(p) ) then 
   if not cmd then 
      outputChatBox("SYNTAX: /"..cmd.." [id]", p) 
   else 
       local query_two = mysql:query ( "DELETE FROM fuelpumps WHERE id='"..id.."'") 
       if query_two then  
       outputChatBox("Fuel pump successfully deleted.", p, 0, 255, 0) 
       end 
     end 
  end 
end 
addCommandHandler("delpump", pump_rem) 

Well Idk what I have done, but people createPump, and then it inserts to MySQL with certain ID's.

But I want to now make a command so people can delete them certain ID's.. how would I do it?

e.g. If person create's pump with ID 1 in MySQL Database, but after want to delete it they do -

./delpump 1

How would I do this please, help!

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