Hi there,
Thanks to everyone who helps here. I recently wrote a script, with the help of some brilliant people here, which when you enter a username is either adds it to the database or finds it and gives that user 1 point. In my output code it displays the results in a table.
However I want an extra column. I have a column which outputs the username and a column which outputs the points that person has. I need a column which reads the number of points and if it is between certain values it shows 1 picture etc.
I can replace the output text with the image code but for now if somebody can help they can simply post the text here in:
0-2 Private
3-6 Corporal
7-11 2nd Lieutenant
12-18 Lieutenant
19-27 Captain
28+ Field Marshall
Here is the current output code:
<?php
$con = mysql_connect("DB CONNECT","USERNAME","PASS");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DB NAME", $con);
$result = mysql_query("SELECT * FROM DB TABLE");
echo "<table border='1' align='center' width='80%'>
<tr>
<th>Username</th>
<th>Rank Points</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['points'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
Thanks for any help 🙂