Ver Mensaje Individual
  #8 (permalink)  
Antiguo 14/07/2005, 01:09
_Lobo_
 
Fecha de Ingreso: junio-2005
Mensajes: 111
Antigüedad: 18 años, 10 meses
Puntos: 0
ya encontre la solucion, muchas gracias por su ayuda ! genial este foro

Código PHP:
<?php require_once('../../Connections/conn_newland.php'); ?>
<?php
mysql_select_db
($database_conn_newland$conn_newland);
$query_rs_countries "SELECT ID, Surname FROM tbl_instructores ORDER BY Surname ASC";
$rs_countries mysql_query($query_rs_countries);
$row_rs_countries mysql_fetch_assoc($rs_countries);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?php 

// Database Connection 
mysql_select_db('newland_tours'mysql_pconnect('localhost','root','root')) or die (mysql_error()); 

// If current page number, use it 
// if not, set one! 

if(!isset($_GET['page'])){ 
    
$page 1
} else { 
    
$page $_GET['page']; 


// Define the number of results per page 
$max_results 10

// Figure out the limit for the query based 
// on the current page number. 
$from = (($page $max_results) - $max_results); 

// Perform MySQL query on only the current page number's results 

$sql mysql_query("SELECT * FROM tbl_instructores LIMIT $from, $max_results"); 

while(
$row_rs_countries mysql_fetch_array($sql)){ 
//do {
    // Build your formatted results here. 
    //echo $row['Surname'] . " ID: " . $row['ID'] . "<br />"; 

echo $row_rs_countries["Surname"]. " ID: " $row_rs_countries['ID'] . ' <a href="instructores_update.php?ID='.$row_rs_countries["ID"].'">Modify this countrys profile</a> '"<br />"
//}    
        //while ($row_rs_countries = mysql_fetch_assoc($rs_countries));
    



// Figure out the total number of results in DB: 
$total_results mysql_result(mysql_query("SELECT COUNT(*) as Num FROM tbl_instructores"),0); 

// Figure out the total number of pages. Always round up using ceil() 
$total_pages ceil($total_results $max_results); 

// Build Page Number Hyperlinks 
echo "<center>Select a Page<br />"

// Build Previous Link 
if($page 1){ 
    
$prev = ($page 1); 
    echo 
"<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\"><<Previous</a> "


for(
$i 1$i <= $total_pages$i++){ 
    if((
$page) == $i){ 
        echo 
"$i "
        } else { 
            echo 
"<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> "
    } 


// Build Next Link 
if($page $total_pages){ 
    
$next = ($page 1); 
    echo 
"<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next>></a>"

echo 
"</center>"
?> 

Alright, it looks like I have some explaining to do! Let's break the code 

</body>
</html>