Question: I am new to HTML/JSP, i am trying to build a tiny shop online website. I have successfully connected to MySQL Database, in my database there is a table hold all the information about stuff i want to sell (image, price, description etc.) and I created a products.jsp that will show all the image of the stuff i sell, each image will redirect to one jsp page name stuff.jsp. How can I set an ID for each image in order to match with ones in database so that in stuff.jsp will show what stuff that i clicked

I have tried so far:
in my database SQL:

```
    create table products(
ID int not null auto_increment,
product_name varchar (40),
price int,
description varchar (100),
primary key(ID))

```

and in my products.jsp, i created some image link like:

```
  <a href="stuffs.jsp"><img src="images/php.jpg" alt="Image"></a>
<a href="stuffs.jsp">Khi Nguoi Lon Co Don Pham Hong Phuoc</a>

```

Answer: 
In Ruby, as @Daniel points out, accessing multidimensional array elements is done as it is done in, for example, C.

The notation you're attempting to use is from, for example, Pascal, but doesn't work the way you think it does in Ruby. What it does in Ruby is give a start index and a count.

So if you have:

```
 a = ['a','b','c','d','e','f']

```

Then `a[2,3]` will be:

```
 ['c','d','e']

```

This is described in the Ruby [Array class documentation](http://www.ruby-doc.org/core-2.1.0/Array.html). If you attempt to assign to it, Ruby will dynamically change the array accordingly. In the above example, if I do this:

```
a[2,3] = 'h'

```

Then `a` will become:

```
['a','b','h','f']

```

Or if I do this:

```
a[2,0] = 'j'

```

Ruby inserts a value at position 2 and now I get:

```
['a','b','j','h','f']

```

In other words, assigning a value to `a[2,3]` replaced the subarray of three values with whatever I assigned to it. In the case of a two-dimensional array, such as in the original example,

```
a[0,0] = 'a'    # Inserts a new first row of array with value 'a'
a[0,1] = 'b'    # Replaces the entire first row of array with 'b'
a[0,2] = 'c'    # Replaces the entire first two rows of array with 'c'
a[1,0] = 'd'    # Inserts a new first row of array with value 'd'
a[1,1] = 'e'    # Replaces the entire second row of array with 'e'
a[1,2] = 'f'    # Replaces the entire second and third rows of array with 'f'

```

Thus, you get the result that you see.
You're currently assigning letters to a range of the outer array. This is the syntax to reference the inner arrays:

```
a[0][0]='a'

```