0
function gethotproperty($hot){
        $gethot = "select p.reference_id, p.area, p.area_unit, p.transaction_type,p.property_type,p.property_name,p.address1,p.address2,p.city,p.locality,p.pincode,p.area_in_sqft,p.total_price,p.negotiable,".
                        "p.rate_per_sqft,p.num_bedrooms,p.floor_number,p.intro_image_loc,p.amenities_detail, p.specification_detail, p.location_detail from " . DBConf::getDatabaseSchema() . "property p where p.hot = ".$hot;
        $result = mysql_query($gethot, $this->connection);

        $property = new Property();


        while($row = mysql_fetch_array($result)){
            $property->referenceId = $row['reference_id'];
            $property->transactionType = $row['transaction_type'];
            $property->propertyType = $row['property_type'];
            $property->propertyName = $row['property_name'];
            $property->address1 = $row['address1'];
            $property->address2 = $row['address2'];
            $property->city = $row['city'];
            $property->locality = $row['locality'];
            $property->pinCode = $row['pincode'];
            $property->areaInSqFt = $row['area_in_sqft'];
            $property->area = $row['area'];
            $property->areaUnit = $row['area_unit'];
            $property->totalPrice = $row['total_price'];
            $property->isNegotiable = $row['negotiable'];
            $property->ratePerSqFt = $row['rate_per_sqft'];
            $property->numberOfBedrooms = $row['num_bedrooms'];
            $property->floorNumber = $row['floor_number'];
            $property->amenities = $row['amenities_detail'];
            $property->introImageLocation = $row['intro_image_loc'];
            $property->specificationDetails = $row['specification_detail'];
            $property->locationDetails = $row['location_detail'];

        }
        return $property;
    }

what is wrong with this script.keep getting an error:

mysql_fetch_array(): supplied argument is not a valid MySQL result resource.

Edited by mike_2000_17: Fixed formatting

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

Looks like an error in your query. Change

$result = mysql_query($gethot, $this->connection);

into

$result = mysql_query($gethot, $this->connection) or die(mysql_error());

to check if I'm right.

0

yes you were right. Thank you so much. it is solved.No error but not displaying anything.

Edited by anony: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.