/    Sign up×
Community /Pin to ProfileBookmark

Retrieve entries from db then display in different tables

In my database table [B]intranet_request[/B] I have different request entries…I want to create some code that retrieves the last 3 requests and put those request in different html tables on that page. Does this make any sense? If so how do I go about this.

[SIZE=”3″]This is how I would like it to be displayed[/SIZE]
<table>
<tr>
<td> REQUEST 1</td>
<td> REQUEST 2</td>
</tr>
</table>

<table>
<tr>
<td>REQUEST 3</td>
</tr>
</table>

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@FrostBiteFeb 22.2008 — Are you using MySQL? If you are you're going to want to look up "order" and "limit" keywords in your select statement. Hope this helps.

-Frosty
Copy linkTweet thisAlerts:
@euqropFeb 22.2008 — How about count the records and then select from x to x ???
Copy linkTweet thisAlerts:
@raistlinFeb 22.2008 — Try this ?
[code=php]
<table>
<tr>
<?php
$numberYouLike = 1;
$request = 'contain the result of your db request in mysql_fetch_array';

for($i=0;$i<=$numberYouLike;$i++)
{
echo "<td> {$request[$i]}</td>";
}
?>
</tr>
</table>

<table>
<tr>
<?php echo "<td>{$request[2]}</td>"; ?>
</tr>
</table>
[/code]
×

Success!

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