/    Sign up×
Community /Pin to ProfileBookmark

Alright, I have some data on a table (let’s call the table “tableMoo”) and there are 5 elements on it mooID, mooName, mooLocation, mooCategory, mooCaption. I need to display them in a layout like below for [b]each[/b] entry. How would I go about doing this?

Layout:

[code=html]<table>
<tr>
<td>mooName</td>
<td>mooCategory</td>
</tr>

<tr>
<td>mooID</td>
</tr>

<tr>
<td>moocaption</td>
</tr>
</table>[/code]

Help is appreciated.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@BobalandiauthorFeb 19.2008 — Anyone? This is semi-urgent.
Copy linkTweet thisAlerts:
@NogDogFeb 20.2008 — Assuming MySQL, see the examples on the [url=http://www.php.net/mysql_fetch_assoc]mysql_fetch_assoc() page[/url].
Copy linkTweet thisAlerts:
@BobalandiauthorFeb 20.2008 — So, would I do:
[code=php]$sql = "SELECT mooID, mooName, mooCategory, mooCaption
FROM tableMoo
WHERE mooID <> NULL";[/code]
Copy linkTweet thisAlerts:
@BobalandiauthorFeb 20.2008 — Wait, couln't I just do [code=php]SELECT * FROM tableMoo[/code] If I wanted all the data from the table? Would that work?
Copy linkTweet thisAlerts:
@MrCoderFeb 20.2008 — Wait, couln't I just do [code=php]SELECT * FROM tableMoo[/code] If I wanted all the data from the table? Would that work?[/QUOTE]

Yes
×

Success!

Help @Bobalandi 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.7,
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,
)...