
April 7th, 2003, 11:43 PM
|
|
Goldmember
|
|
Join Date: Nov 2002
Posts: 71
Time spent in forums: 5 m 25 sec
Reputation Power: 6
|
|
|
Spaning MySQL results over multiple pages
hello, haven't been around too much lately, but, i have run into a problem! for a certain site, i originally wished to display member bio's from a database, have a form to add a new bio, etc. and everything worked out and went fine...now, the member's are increasing in number and i've worked out a search feature and all of that good stuff but i don't have a clue as to how to span the biographies on the REG. "bios.php" over multiple pages. i retrieve the info from the db using the following code; the database accessing class, etc, is based off of Ben Rowe's fabulous core, here goes:
PHP Code:
function getbios() {
$dbVars = new dbVars();
@$svrConn = mysql_connect($dbVars->strServer, $dbVars->strUser, $dbVars->strPass);
if($svrConn)
{
$dbConn = mysql_select_db($dbVars->strDb, $svrConn);
if($dbConn)
{
$query = "SELECT * FROM members";
$result = mysql_query($query);
if($result != NULL) {
echo '<table width="50%" border="1" bordercolor="#FFFFFF" cellpadding="3" cellspacing="3">';
while($row = mysql_fetch_array($result)) {
echo ' <p>';
echo ' <tr>';
echo ' <td height="117" colspan="2"><center><img src="' . $row[8] .'"></center></td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td width="30%">Name</td>';
echo ' <td width="70%">' . $row[1] . '</td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td>Age</td>';
echo ' <td>' . $row[2] . '</td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td>E-mail</td>';
echo ' <td>' . $row[3] . '</td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td>Position</td>';
echo ' <td>' . $row[4] . '</td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td>Status</td>';
echo ' <td>' . $row[5] . '</td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td>AIM</td>';
echo ' <td>' . $row[6] . '</td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td>MSN</td>';
echo ' <td>' . $row[7] . '</td>';
echo ' </tr>';
echo ' </p>';
}
echo '</table>';
} else {
echo 'There are currently no members.';
}
}
}
}
what code needs to be added, and also, plz correct any small mistakes i may have made  , many thanks 
__________________
-Alexander
|