Forum Moderators: coopster
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"name");
$f2=mysql_result($result,$i,"score");
$f3=mysql_result($result,$i,"ip");
?>
<table>
<tr>
<td><?php echo ucfirst($f1); ?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $f3; ?></td>
</tr>
</table> Easier done than said:
hide two octets of ip in php from sql db
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"name");
$f2=mysql_result($result,$i,"score");
$f3=mysql_result($result,$i,"ip");
$ip=$f3;
$a=explode(".",$ip);
$newip="$a[0].$a[1].***.***";
?>
<table>
<tr>
<td><?php echo ucfirst($f1); ?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $newip; ?></td>
</tr>
</table> <?php
require_once('/home/user/php/db.php');
mysql_connect($hostname,$username1,$password);
@mysql_select_db($database1) or die( "Unable to select database");
$query = ("SELECT name, score, ip FROM $table1 ORDER BY score DESC LIMIT 0, $display_max") or error_msg('Could not retrieve scores.');
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<table>
<tr>
<th><a href="link1.php">Link1</a></th>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</table>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"A");
$f2=mysql_result($result,$i,"B");
$f3=mysql_result($result,$i,"C");
$ip=$f3;
$a=explode(".",$ip);
$newip="$a[0].$a[1].*.*";
?>
<table>
<tr>
<td><?php echo ucfirst($f1); ?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $newip; ?></td>
</tr>
</table>
<?php
$i++;
}
?>