Question: new to Java. So I want the user to be able to stop the payment process anytime they want to by typing "quit". How can I achieve that? Tried the do-while loop but its not working. Here is the code

```
  public void payItems() {
    Scanner s = new Scanner(System.in);
    String word;
    do {
        System.out.println("Enter name: ");
        String name = s.next();
        s.nextLine();
        //where should I put word = s.next
        System.out.println("Enter address: ");
        String address = s.nextLine();
        System.out.println("Enter card number: ");
        int cardNo = s.nextInt();
        System.out.println("Enter card expiration date: (DDMMYY)");
        int expirationDate = s.nextInt();
        Customer newcust = new Customer(name, address, cardNo, expirationDate);
    } while (!word.equals("quit"));
}

```

Answer: 
You can do something like below using [`INSTR()`](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_instr) function

```
SELECT * FROM your_table
WHERE INSTR('This is a computer', word) > 0

```
If you have many words in table, mb, preferable will be using of such query:

```
SELECT word
FROM table_with_words
WHERE FIND_IN_SET(word, REPLACE('This is a computer', ' ', ',')) != 0

```