case 2: /*Guild House 1*/
QueryResult *result = NULL; // Just defining our result as a member of QueryResult
result = CharacterDatabase.Query(" SELECT guildId FROM guildhouses WHERE guildId =%u", m_guildId "); // Runs the query to select the field
uint32 guildId = result->Fetch()->GetUInt32();
if(guildId==%u)
{
Item * item = objmgr.CreateItem( 100601 , thisPlr );
thisPlr->GetItemInterface()->AddItemToFreeSlot( item );
}else{
Plr->GetSession()->SendNotification("This is not your guild house!");
}
}
break;