Thanks for your code but i have one important problem. The problem is that i want to disable booked seat it will fetch from database so please provide me that code also.I am so confused please help me.

It's a little hard to follow with the JS in there as to the intent of onclick action especially when all parts of the page are unknown. Noticed also you lost the "Bus" grid you desired in OP. I'll take a shot in the dark with this example.

mysql extension is deprecated as of PHP 5.5.0, and will be removed in the future. This means at some point your host may upgrade their server and mysql may not be supported.Also using bindParam() as in my example, you are escaping values e.g. joe\'s and protecting against SQL injection attacks where someone might try to submit malicious code into a form field to gain access to your database.

Hey, I know this thread is a little old but I never got back to you. Tables are built in rows and you are asking for seats to be numbered by column. That's a little hard to pull off, especially when dealing with aisle spaces, where you would skip a number. I ended up making an array using the existing letter/number combination as the key and the value being the number you wish to see. Using seat images as the cell background and the link/number as the value.