I need help writing a script that will get the all the stuff that are in two fields and order them by the number. Is there a way i can do it?
Here's my format.
hawkshar_doc is my DB Name
user Table
email field
dp field
team field
I would like for the script to show the email and the dp field only, and order by number in the dp field .
Also i got another thing...
Is there a way i can have another site where it only shows the people who have like team number 1 in the team field?
Thank in advance!
Help please:)
Moderator: General Moderators
Never mind my last post, just do this:
Connect to the database as normal, then where you want the fields to be shown in the document add this:
<table width="100%">
<?php
$userlist = mysql_query("SELECT email, team FROM user ORDER BY dp DESC");
while ($list= mysql_fetch_array($userlist)) {
$email= $product["email"];
$team= $product["team"];
$dp= $product["dp"];
?>
<tr>
<td>
<?=$email?>
</td>
</tr>
<tr>
<td >
<?=$dp ?>
</td>
</tr>
<?php
}
?>
</table>
Connect to the database as normal, then where you want the fields to be shown in the document add this:
<table width="100%">
<?php
$userlist = mysql_query("SELECT email, team FROM user ORDER BY dp DESC");
while ($list= mysql_fetch_array($userlist)) {
$email= $product["email"];
$team= $product["team"];
$dp= $product["dp"];
?>
<tr>
<td>
<?=$email?>
</td>
</tr>
<tr>
<td >
<?=$dp ?>
</td>
</tr>
<?php
}
?>
</table>