#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0

    Ruby program method call doesn't appear to be working


    I am writing a program using Ruby on Rails to allow users to manage University courses, their modules, and the students enrolled on them.

    Currently, I have two classes: Application.rb and CourseModules.rb:

    Application.rb is the class that I am using to interface with the user- it currently looks like this:

    Code:
      
    class Application
      # To change this template use File | Settings | File Templates.
      require './courseModules.rb'
      def initialize
        main_menu
      end
    
    =begin
      def navigateTo(what)
        what.new(v).display
        mainMenu
      end
    =end
    
      def main_menu
        puts "What would you like to do?
              1: Add module to a scheme
              2: Remove module from a scheme
              3: Query modules
              4: Modify module
              5: Register a student on a scheme
              6: Remove a student from a scheme
              7: Register a student on a module
              8: Remove a student from a module"
        case gets.strip
          when "1"
            CourseModules.add_module
          when "2"
            CourseModules.removeModuleFromScheme
          when "3"
            navigateTo CourseModules
          when "4"
            navigateTo CourseModules
          when "5"
            navigateTo Student
          when "6"
            navigateTo Student
          when "7"
            navigateTo Student
        end
      end
      Application.new
    end
    and CourseModules.rb is where I am doing all of the work- it currently looks like this:

    Code:
    class CourseModules
    # To change this template use File | Settings | File Templates.
       @@moduleScheme = nil
       @@moduleYear = nil
       #@moduleTitle = ""
       @noOfModulesInScheme = 0
    
       def self.moduleYear
         @@moduleYear
       end
    
       def initialize(v)
         @val = v
       end
       # Set and get the @val object value
       def set (v)
         @val = v
       end
       def get
         return @val
       end
    
    
       # Attempt at add_module method on 21/08/2012 at 16:30
       def self.add_module
         schemes = {}
         scheme_exists = false
         add_another_scheme = true
         add_another_module = true
    
         while add_another_scheme
           print "Enter scheme name: "
           scheme_name = gets
           schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false
    
           if !scheme_exists
             schemes[scheme_name.chop] = []
             puts "Scheme #{scheme_name.chop} has been added to the system"
           else
             scheme_exists = false
             puts "This scheme has already been added"
           end
    
           while add_another_module
             print "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop].include?(module_name.chop) ? true : schemes[scheme_name.chop] << module_name.chop
             print "Add another module? "
             ask_if_user_wants_to_add_another_module = gets
             if(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module == "yes")
              add_another_scheme = false
             else if(ask_if_user_wants_to_add_another_module.chop != "y" or ask_if_user_wants_to_add_another_module != "yes")
               Application.main_menu
                  end
           end
    
         end
    
         print "Add another scheme? "
         ask_if_user_wants_to_add_another_scheme = gets
         if !(ask_if_user_wants_to_add_another_scheme.chop == "y" or ask_if_user_wants_to_add_another_scheme.chop == "yes")
           add_another_scheme = false
         end
         puts @schemes
    
        end
    
         while add_another_module
           print "Enter scheme name: "
           scheme_name = gets
           schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false
    
           if !scheme_exists
             print "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop] = module_name.chop
             puts "Scheme #{scheme_name.chop} with module #{module_name} has been added to the system"
           else
             scheme_exists = false
             puts "This scheme has already been added"
             puts "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop] = module_name.chop
             puts "Scheme #{scheme_name.chop} with module #{module_name} has been added to the system"
           end
    
           print "Add another module? "
           ask_if_user_wants_to_add_another_module = gets
           if !(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module.chop == "yes")
             add_another_module = false
           end
         end
         puts schemes
       end
    
    end
    At present, when I run the program from Application.rb, I am presented with the menu, and I choose option 1: "Add module to a scheme"

    I am then asked to enter a scheme name, which I do, and a line appears telling me that the scheme has been added to the system.

    Next, I am asked to enter the name of the module, which I do, and am then asked if I'd like to enter another module. If I type 'y' or 'yes', I am allowed to enter the name of another module.
    However, if I type 'n' or anything other than 'y' or 'yes', the program crashes and I get a few errors in the console.

    The first of these errors says:

    in `add_module': undefined method `main_menu' for Application:Class (NoMethodError)
    on the line:

    Code:
    Application.main_menu
    in the
    Code:
    def self.add_module
    method in my CourseModules.rb class.

    What should happen is that when the user enters 'n' or anything other than 'y' or 'yes' when asked if they'd like to add another module, they should be taken back the program main menu.

    Does anyone have any idea what I'm doing wrong here? How can I put it right?
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    main_menu is an instance method, not a class method. You either have to define it as a class method (which makes sense in this case) or create an instance of Application and then call the method on it.

    Apart from that, there are some logical errors and unneccessary complicated code.

    For example:
    Code:
    if(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module == "yes")
      add_another_scheme = false
    else if(ask_if_user_wants_to_add_another_module.chop != "y" or ask_if_user_wants_to_add_another_module != "yes")
        Application.main_menu
      end
    end
    Using "else if" like in C based languages is a bad idea in Ruby. This requires a double "end" and is completely unnecessary. What you're looking for is "elsif":
    Code:
    if ...
      ...
    elsif ...
      ...
    elsif ...
      ...  
    ...
    else
      ...
    end
    The second condition is a tautology. It's always true, because a String obviously cannot equal "y" and "yes" at the same time. You don't even need a condition here, simply use "else".

    You should also avoid repeating the long variable all the time. Use a regex or an array of possible answers:
    Code:
    ask_if_user_wants_to_add_another_module.chop =~ /y(?:es)?/i
    The code
    Code:
    schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false
    can be boiled down to a simple assignment:
    Code:
    scheme_exists = schemes.has_key?(scheme_name.chop)
    Because the result of "has_key?" already is a boolean.

    And you shouldn't switch between camelCase and underscore_names. The Ruby convention is to use underscores for all methods and variables.
    Last edited by Jacques1; August 22nd, 2012 at 06:37 AM.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0
    Ok, I've made some of the changes suggested, but I'm still having a couple of problems.

    My CourseModules.rb class now looks like this:

    Code:
     
    class CourseModules
    # To change this template use File | Settings | File Templates.
       @@moduleScheme = nil
       @@moduleYear = nil
       #@moduleTitle = ""
       @noOfModulesInScheme = 0
    
       def self.moduleYear
         @@moduleYear
       end
    
       def initialize(v)
         @val = v
       end
       # Set and get the @val object value
       def set (v)
         @val = v
       end
       def get
         return @val
       end
    
    
       # Attempt at add_module method on 21/08/2012 at 16:30
       def self.add_module
         schemes = {}
         scheme_exists = false
         add_another_scheme = true
         add_another_module = true
    
         while add_another_scheme
           print "Enter scheme name: "
           scheme_name = gets
           schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false
    
           if !scheme_exists
             schemes[scheme_name.chop] = []
             puts "Scheme #{scheme_name.chop} has been added to the system"
           else
             scheme_exists = false
             puts "This scheme has already been added"
           end
    
           while add_another_module
             print "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop].include?(module_name.chop) ? true : schemes[scheme_name.chop] << module_name.chop
             print "Add another module? "
             ask_if_user_wants_to_add_another_module = gets
             if(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module == "yes")
              add_another_scheme = false
             else if(ask_if_user_wants_to_add_another_module.chop != "y" or ask_if_user_wants_to_add_another_module != "yes")
               Application.main_menu
                  end
           end
    
         end
    
         print "Add another scheme? "
         ask_if_user_wants_to_add_another_scheme = gets
         if !(ask_if_user_wants_to_add_another_scheme.chop == "y" or ask_if_user_wants_to_add_another_scheme.chop == "yes")
           add_another_scheme = false
         end
         puts @schemes
    
        end
    
         while add_another_module
           print "Enter scheme name: "
           scheme_name = gets
           schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false
    
           if !scheme_exists
             print "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop] = module_name.chop
             puts "Scheme #{scheme_name.chop} with module #{module_name} has been added to the system"
           else
             scheme_exists = false
             puts "This scheme has already been added"
             puts "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop] = module_name.chop
             puts "Scheme #{scheme_name.chop} with module #{module_name} has been added to the system"
           end
    
           print "Add another module? "
           ask_if_user_wants_to_add_another_module = gets
           if !(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module.chop == "yes")
             add_another_module = false
           end
         end
         puts schemes
       end
    
    end
    and my Application.rb class looks like this:

    Code:
    class Application
      # To change this template use File | Settings | File Templates.
      require './courseModules.rb'
      def initialize
        main_menu
      end
    
    =begin
      def navigateTo(what)
        what.new(v).display
        mainMenu
      end
    =end
    
      def self.main_menu
        puts "What would you like to do?
              1: Add module to a scheme
              2: Remove module from a scheme
              3: Query modules
              4: Modify module
              5: Register a student on a scheme
              6: Remove a student from a scheme
              7: Register a student on a module
              8: Remove a student from a module"
        case gets.strip
          when "1"
            CourseModules.add_module
          when "2"
            CourseModules.removeModuleFromScheme
          when "3"
            navigateTo CourseModules
          when "4"
            navigateTo CourseModules
          when "5"
            navigateTo Student
          when "6"
            navigateTo Student
          when "7"
            navigateTo Student
        end
      end
      Application.new
    end
    When I try running this now, I get an error saying that line 5 in Application.rb (the "main_menu" line in the def initialize method) has an undefined variable or method 'main_menu' (NameError)

    Any suggestions?
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Of course you also have to change the method calls, because the receiver is now the class and not the instance.

    So "main_menu" in the initialize method now must be "self.class.main_menu".
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0
    Ok, that's brilliant, thanks!

    I'm now having trouble trying to validate the data that's entered, i.e. so that the user can't add the same scheme twice- any idea how I would do this?

    I'm sure I previously had it working with this code block:

    Code:
    if !scheme_exists
             schemes[scheme_name.chop] = []
             puts "Scheme #{scheme_name.chop} has been added to the system"
           else
             scheme_exists = false
             puts "This scheme has already been added"
           end
    But it seems to have stopped working for some reason.

    Also, do you know how I could ensure that whatever the user enters into the module_ID variable is unique? I.e. that a module with that ID has not already been entered?

    Code:
    class CourseModules
    # To change this template use File | Settings | File Templates.
       @@moduleScheme = nil
       @@moduleYear = nil
       #@moduleTitle = ""
       @noOfModulesInScheme = 0
    
       def self.moduleYear
         @@moduleYear
       end
    
       def initialize(v)
         @val = v
       end
       # Set and get the @val object value
       def set (v)
         @val = v
       end
       def get
         return @val
       end
    
    
       # Attempt at add_module method on 21/08/2012 at 16:30
       def self.add_module
         schemes = {}
         scheme_exists = false
         add_another_scheme = true
         add_another_module = true
    
         while add_another_scheme
           print "Enter scheme name: "
           scheme_name = gets
           schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false
    
           if !scheme_exists
             schemes[scheme_name.chop] = []
             puts "Scheme #{scheme_name.chop} has been added to the system"
           else
             scheme_exists = false
             puts "This scheme has already been added"
           end
    
           while add_another_module
             print "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop].include?(module_name.chop) ? true : schemes[scheme_name.chop] << module_name.chop
            # puts "Module #{module_name.chop} has been added to #{scheme_name.chop}"
    
             # 22/08/2012 at 14:15 Now need to read in each module's unique identifier and year it belongs to
             print "Enter module ID: "
             module_ID =gets
             schemes[scheme_name.chop].include?(module_ID.chop) ? true : schemes[scheme_name.chop] << module_ID.chop
             puts "Module #{module_name.chop}, #{module_ID.chop} has been added to #{scheme_name.chop}"
    
             print "Add another module? "
             ask_if_user_wants_to_add_another_module = gets
             if(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module == "yes")
              add_another_scheme = false
             else if(ask_if_user_wants_to_add_another_module.chop != "y" or ask_if_user_wants_to_add_another_module != "yes")
               Application.main_menu
                  end
           end
    
         end
    
         print "Add another scheme? "
         ask_if_user_wants_to_add_another_scheme = gets
         if !(ask_if_user_wants_to_add_another_scheme.chop == "y" or ask_if_user_wants_to_add_another_scheme.chop == "yes")
           add_another_scheme = false
         end
         puts @schemes
    
        end
    
         while add_another_module
           print "Enter scheme name: "
           scheme_name = gets
           schemes.has_key?(scheme_name.chop) ? scheme_exists = true : scheme_exists = false
    
           if !scheme_exists
             print "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop] = module_name.chop
             puts "Scheme #{scheme_name.chop} with module #{module_name} has been added to the system"
           else
             scheme_exists = false
             puts "This scheme has already been added"
             puts "Enter module name: "
             module_name = gets
             schemes[scheme_name.chop] = module_name.chop
             puts "Scheme #{scheme_name.chop} with module #{module_name} has been added to the system"
           end
    
           print "Add another module? "
           ask_if_user_wants_to_add_another_module = gets
           if !(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module.chop == "yes")
             add_another_module = false
           end
         end
         puts schemes
       end
    
    end
  10. #6
  11. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    It doesn't work, because when the user doesn't want to add further modules, you restart the application by calling Application.main_menu. This completely resets the schemes array.

    The program logic is generally flawed. The module adding loop is endless, so half of the program is never executed (since you didn't even notice this, it looks pretty useless). Also none of the calls to Application.main_menu ever return, which means that Ruby's call stack will blow up after a while (you can only run a limited number of method calls at the same time).

    So before you go on, I think you should work out a concept of how the menu works and then implement only the control flow. Be careful not to create an endless chain of method calls.

    You'll also have to think about a database, because storing the data only for a session obviously doesn't make too much sense.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0
    Originally Posted by Jacques1
    It doesn't work, because when the user doesn't want to add further modules, you restart the application by calling Application.main_menu. This completely resets the schemes array.

    The program logic is generally flawed. The module adding loop is endless, so half of the program is never executed (since you didn't even notice this, it looks pretty useless). Also none of the calls to Application.main_menu ever return, which means that Ruby's call stack will blow up after a while (you can only run a limited number of method calls at the same time).

    So before you go on, I think you should work out a concept of how the menu works and then implement only the control flow. Be careful not to create an endless chain of method calls.

    You'll also have to think about a database, because storing the data only for a session obviously doesn't make too much sense.
    So would it make sense to write another menu to call, instead of the original one, after having already performed one or more functions, so that the schemes array is not reset?

    I didn't think that the module adding loop was endless because of this bit of code:

    Code:
    print "Add another module? "
             ask_if_user_wants_to_add_another_module = gets
             if(ask_if_user_wants_to_add_another_module.chop == "y" or ask_if_user_wants_to_add_another_module == "yes")
              add_another_scheme = false
             else if(ask_if_user_wants_to_add_another_module.chop != "y" or ask_if_user_wants_to_add_another_module != "yes")
               Application.main_menu
                  end
    which tells it to return to the menu when the user doesn't want to add any more modules... when I run it, and finish adding a couple of modules, it asks again if I want to add another module, if I type 'n', the menu is printed again (although apparently 'forgetting' everything that I've entered already).

    I'm aware that I'll need to think of a database, but I don't know how to use on in this context, is there a particular one you could recommend?
  14. #8
  15. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Originally Posted by someone2088
    So would it make sense to write another menu to call, instead of the original one, after having already performed one or more functions, so that the schemes array is not reset?
    The schemes should be saved in a class variable. But since this is for only for testing, anyway, I don't see why you should put further effort in getting the schemes array right.



    Originally Posted by someone2088
    I didn't think that the module adding loop was endless because of this bit of code:

    ...

    which tells it to return to the menu when the user doesn't want to add any more modules
    You have to distinguish between what the output suggests and what actually happens in the program. When you press "n" and the main menu is printed again, it looks like the first menu is "finished".

    But that's not the case. In reality, the main_menu method called itself and now waits for this call to return -- which never happens. So when you're navigating through the main menus, you basically create an ever-growing stack of main_menu calls all waiting for each other to finish.

    Since the call stack is limited (as I already said), your program will blow up after a while, printing "Stack level too deep".

    So if you want to go to the main menu again, you must not call the main_menu method within the main_menu method. Instead, the current method must return, and then you need an external while loop, which will call the method again.

    But like I said, you should first create an exact concept of how the menu works. Draw a flowchart or something.



    Originally Posted by someone2088
    I'm aware that I'll need to think of a database, but I don't know how to use on in this context, is there a particular one you could recommend?
    Since you probably don't want to install a full blown database system just for this program, I recommend using SQLite:
    http://www.sqlite.org/
    http://www.skorks.com/2009/08/instal...by-on-windows/
    It's extremely lightweight and meant to be embedded into your application. The actual database is a simple file you can keep with your scripts.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0
    Originally Posted by Jacques1
    The schemes should be saved in a class variable. But since this is for only for testing, anyway, I don't see why you should put further effort in getting the schemes array right.





    You have to distinguish between what the output suggests and what actually happens in the program. When you press "n" and the main menu is printed again, it looks like the first menu is "finished".

    But that's not the case. In reality, the main_menu method called itself and now waits for this call to return -- which never happens. So when you're navigating through the main menus, you basically create an ever-growing stack of main_menu calls all waiting for each other to finish.

    Since the call stack is limited (as I already said), your program will blow up after a while, printing "Stack level too deep".

    So if you want to go to the main menu again, you must not call the main_menu method within the main_menu method. Instead, the current method must return, and then you need an external while loop, which will call the method again.

    But like I said, you should first create an exact concept of how the menu works. Draw a flowchart or something.





    Since you probably don't want to install a full blown database system just for this program, I recommend using SQLite:
    http://www.sqlite.org/
    http://www.skorks.com/2009/08/instal...by-on-windows/
    It's extremely lightweight and meant to be embedded into your application. The actual database is a simple file you can keep with your scripts.
    Sorry, I don't fully understand- why do I need to make the main_menu return, and how do I do this?

    Does it need to return anything? As it's not performing any calculations, it's just callling other methods...
  18. #10
  19. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    The method doesn't have to return a value, but it must return before you call it again.

    The reason I explained earlier: If the method calls itself again and again without ever returning, the call stack (where method calls are kept) will be full after a while. Because what you're doing is an infinite recursion.

    It basically does the same as this code:
    Code:
    def f
      f
    end
    
    f
    which after some thousand calls leads to
    Code:
    stack level too deep (SystemStackError)
    So in order to go back to the main menu, you need to return from the current Application.main_menu and have it called again by an outer loop:
    Code:
    loop do
      Application.main_menu
    end
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0
    Originally Posted by Jacques1

    So in order to go back to the main menu, you need to return from the current Application.main_menu and have it called again by an outer loop:
    Code:
    loop do
      Application.main_menu
    end
    Ok, thanks for the explanation- that's really helpful.
    So when you say I need to have Application.main_menu called again by an outer loop, does that mean putting
    Code:
    def self.main_menu
    and all of the code within that block inside another block- the outer loop? I tried nesting it inside another loop, and then calling that outer loop from the end of my add_module method in the CourseModules class, but that threw up some errors. Could you give me a more detailed example?
  22. #12
  23. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    You have to replace the initial call of Application.main_menu with a loop of main_menu calls.

    So in your case you have to change the initialize method of Application to
    Code:
    def initialize
      loop do
        Application.main_menu
      end
    end
    Whenever you want to go back to the main menu, you must return from the current Application.main_menu. In the case of add_module you simply have to replace all "Application.main_menu" with "return". Then the loop above will call Application.main_menu again.

    I hope this clears it up. The point is that you'll have a sequence of isolated calls to main_menu instead of "nested" calls where the outer method is still running.

    Your current call scheme looks like this:
    Code:
    main_menu(
      main_menu (
        main_menu (
          ...
        )
      )
    )
    This must be replaced with
    Code:
    main_menu() -> main_menu() -> main_menu() -> ...
    Last edited by Jacques1; August 25th, 2012 at 03:22 AM.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo