Displaying Multiple Property Names

Displaying Multiple Property Names

Postby DeltaDave » Sun Feb 22, 2009 1:06 pm

Hi Chris
I know this is a basic question but I cannot seem to find the answer here.
On the calendar display page the line below displays the Title (which I have set as 'Availability for') followed by the item id
<h2>'.$lang["title"].''.$id_item.'</h2>
But how do I get that item id to display the actual property name?
I know I have to define the actual property names relative to the ids but it escapes me how to do it.
I know it is basic but I have brain freeze!
David
DeltaDave
 
Posts: 3
Joined: Sun Feb 22, 2009 12:55 pm

Re: Displaying Multiple Property Names

Postby chris » Sun Feb 22, 2009 2:44 pm

Hi there Dave,
This could be done in various ways.
Ideally the item names would be in a database table with the name (and any other data) associated to the id.
Alternatively you could create an array of items like this:
Code: Select all
$items=array("1"=>"item 1", "2"=>"name 2","3"=>"name 3");

And then within the h2 tag display the item name like this:
Code: Select all
<h2>'.$items[$id_item].'</h2>


I hope this helps ;)

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Displaying Multiple Property Names

Postby DeltaDave » Sun Feb 22, 2009 9:04 pm

Thanks Chris
I will give that a try and let you know how I get on.
David
DeltaDave
 
Posts: 3
Joined: Sun Feb 22, 2009 12:55 pm

Re: Displaying Multiple Property Names

Postby DeltaDave » Sun Feb 22, 2009 11:58 pm

Thanks again Chris for your speedy response - that did the trick.
David
DeltaDave
 
Posts: 3
Joined: Sun Feb 22, 2009 12:55 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron