You should probably do the following:
$hotelsDetail = array(); $details = new HotelDetails(); $details->setHotelInfo($rs); $details->setPrice('150');
In your particular case, the problem is that you should use -> , not . . This period is not used in PHP to access class attributes or methods:
$hotelsdetail[0] = new hoteldetails(); $hotelsdetail[0]->sethotelinfo($rs); $hotelsdetail[0]->setprice('150');
Please note that I have correctly described the names of classes, objects, and functions. Writing everything in lower case is not considered a good style.
As a side note, why is your price a string? It really should be a number if you ever want to make the right calculations with it.
slhck source share