/    Sign up×
Community /Pin to ProfileBookmark

Hi all!!

I am trying to display a vertical list from a database but I would like advice how to do it.

My database has the following fields:
facilites_id

Hotel_id

list_facilities – Here is where the data list is stored (swimming pool, restaurant, bar, etc)

I would like to disply this data in a vertical list like this:

# Breakfast Included


# Restaurant


# Internet Access


# Airport Pick Up


# etc

Unfortunately the words come in sequence.

Maybe my table design is weak. I could try the yes/no but I don´t know how to do it.

Any suggestions

sandro27

to post a comment
Full-stack Developer

6 Comments(s)

Copy linkTweet thisAlerts:
@ray326Jan 09.2005 — Mark it up using an unordered list: <ul><li></li>...</ul>.
Copy linkTweet thisAlerts:
@the_treeJan 10.2005 — Just what ray said, start with this:[CODE]<ul>
<li>Breakfast included</li>
<li>Resturant</li>
<li>Et Cetera</li>
</ul>
[/CODE]

Then [url=http://www.alistapart.com/articles/taminglists/]tame those lists[/url] and you'll be sorted.
Copy linkTweet thisAlerts:
@sandro27authorJan 10.2005 — Thanks guys. However I another problem.

Let´s say I have 2 tables:

facilities ( facilities_id, facilities_name)

hotel_facilities ( hotel_id, facilities_id)

I am trying to get data from this tables with sql
[code=php]
include "intro.php";
$sql1="select * from hotel_facilities,facilities where
facilities.facilities_id=hotel_facilities.facilities_id
and acc_id= '$acc_id' order by facilities_name";
$busca1=mysql_query($sql1,$conexao) or die(mysql_error());
$lista1=mysql_fetch_array($busca1);
[/code]


then I show like this
[code=php]
<?
while($lista1=mysql_fetch_array($busca1)){
?>
<ul></ul><li><?=$lista1['facilities_name']?></li>
<?
}
?>
[/code]


The problem is that this doesn´t show all data in the table, always missing one.

Wonder why and appreciate any help

sandro24
Copy linkTweet thisAlerts:
@ray326Jan 11.2005 — Sorry. I'm not a PHP guy but one will come along I'm sure.
Copy linkTweet thisAlerts:
@sajiJan 12.2005 — Hello,

You have to remove the following line from the script.

"$lista1=mysql_fetch_array($busca1);" which is under

"$busca1=mysql_query($sql1,$conexao) or die(mysql_error()); ".

The reason is, mysql_fetch_array would skip one row.

Hope this will help you.

Regards,

Saji John
Copy linkTweet thisAlerts:
@sandro27authorJan 13.2005 — Hi Saji.

It worked perfectly. Thanks. The good be with you in 2005.

sandro27
×

Success!

Help @sandro27 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...