Page 1 of 1

PHP/MySQL stuff

Posted: Thu Nov 28, 2002 11:41 am
by MrOnline
I have a form where users can signup to and it gets unserted into the database ok. But what I want to do as I have seen it done on many sites is say if the click on a members.php link, they will be taken to a page that can dynamically add all users into a table. Then intop of that, say the names have links on them that can take them into user profiles. so it will be like profiles.php?user_id=$user_id

Can you help me figure out how to do this? Here is what I have at the moment:

Code: Select all

<?php
include("connect.php");
$link=mysql_connect($host,$user,$password);
mysql_select_db($db);

include("header.php");

echo "<table border="0" cellpadding="0" cellspacing="0" width="288">\n";
echo "	<tr><td width="288" valign="top"><div class="mainsmalltypenopad"><b>Player Profile</b><br><br></div></td></tr>\n";
echo "</table>\n";

/* ########Page Numbering Setup######
$pages = mysql_num_rows(mysql_query("SELECT player_id FROM $player_table"));
if(!$show) $show="1";
$perpage="5";
############################## */

$read_message="SELECT * FROM $player_table ORDER BY player_name ASC LIMIT";
$read_message_result=mysql_query($read_message);

//while($data=mysql_fetch_array($read_message_result))
&#123;
########Layout ######
$data&#1111;topic]= substr("$data&#1111;title]",0,36);
$data&#1111;player_name]= substr("$data&#1111;player_name]",0,36);
###################

echo " <table width="75%" border="1" cellspacing="0" cellpadding="0">";
echo "  <tr>";
echo "    <td colspan="2"><strong>$data&#1111;player_name] :: <a href="mailto:$data&#1111;player_email]">Contact</a>";
echo "      :: <a href="$data&#1111;player_msngr]">MSN</a> :: <a href="aim:goim?screenname=$data&#1111;player_aim]&message=Hello+Are+you+there?">AIM</a>";
echo "      :: <a href="http://wwp.icq.com/scripts/search.dll?to=$data&#1111;player_icq]">ICQ</a></strong></td>";
echo "  </tr>";
echo "  <tr> ";
echo "    <td>Realm:</td>";
echo "    <td>$data&#1111;player_realm]</td>";
echo "  </tr>";
echo "  <tr>";
echo "    <td>Division:</td>";
echo "    <td>$data&#1111;player_division]</td>";
echo "  </tr>";
echo "  <tr> ";
echo "    <td>Profile:</td>";
echo "    <td> $data&#1111;player_info]</td>";
echo "  </tr>";
echo "  <tr> ";
echo "    <td>Games: </td>";
echo "    <td>$data&#1111;player_games]</td>";
echo "  </tr>";
echo "  <tr> ";
echo "    <td>Wins: </td>";
echo "    <td>$data&#1111;player_wins]</td>";
echo "  </tr>";
echo "  <tr> ";
echo "    <td>Losses: </td>";
echo "    <td>$data&#1111;player_losses]</td>";
echo "  </tr>";
echo " </table>";
&#125;

/* ########Page Numbering Output######
echo "<table width="500" cellspacing="0" cellpadding="0" border="0">\n"; 
echo "	<tr><td>";

if($pages>$perpage) &#123;
$seiten= $pages/$perpage;
if($pages%$perpage) &#123;
$seiten++;
&#125;
&#125;
for ($i=1;$i<=$seiten;$i++) &#123;
$fwd=($i-1)*$perpage;
echo "&#1111;<a href="profile.php?show=$fwd">$i</a>]";
&#125;
echo "</td></tr>\n";
echo "</table>\n";
###############################

mysql_close($link);

include("footer.php");
?>