Jump to content
  • 0

How can i add this to my database?


Leinadz

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  121
  • Reputation:   22
  • Joined:  01/10/13
  • Last Seen:  

Hello, in the script " Coupon NPC 1.1.2" , there is a requirement that i should add "coupons" to my database but i dont know how.

Below of the script , it contains this but i dont know how to add it into SQL.

OnInit:

query_sql "CREATE TABLE IF NOT EXISTS `coupons` (`code` TINYTEXT NOT NULL, `item_id` INT NOT NULL, `item_amount` INT NOT NULL, INDEX `code` (`code`(32)) ) ENGINE=MyISAM";

}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

OnInit label will be trigger when the server startup / reloaded .....

and the contents inside the OnInit label will be executed..

in your case...the table is auto generated by the code inside the OnInit label...

so you dont need to execute any things ... everything is done automatically.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  121
  • Reputation:   22
  • Joined:  01/10/13
  • Last Seen:  

So you mean , i will reload or rerun my server and everything will be fine?

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

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

×
×
  • Create New...